|
@@ -160,26 +160,25 @@ function setStateFromStorage(_this,storageState){
|
|
|
}
|
|
|
}
|
|
|
/* 设置状态值 */
|
|
|
-function setState(_this,storageState){
|
|
|
- if(storageState){
|
|
|
- //设置状态中的各种值
|
|
|
- _this.$store.commit('setIsLogin', storageState.isLogin);
|
|
|
- _this.$store.commit('setToken', storageState.token);
|
|
|
- _this.$store.commit('setAvatar', storageState.avatar);
|
|
|
- _this.$store.commit('setName', storageState.name);
|
|
|
- _this.$store.commit('setIntroduction', storageState.introduction);
|
|
|
- _this.$store.commit('setRoles', storageState.roles);
|
|
|
- _this.$store.commit('setUser', storageState.user);
|
|
|
- _this.$store.commit('setStationName', storageState.stationName);
|
|
|
- _this.$store.commit('setStationCode', storageState.stationCode);
|
|
|
- _this.$store.commit('setDepartmentName', storageState.departmentName);
|
|
|
- _this.$store.commit('setDepartmentCode', storageState.departmentCode);
|
|
|
- _this.$store.commit('setProjectCode', storageState.projectCode);
|
|
|
- }
|
|
|
+function setState(_this,storageState){
|
|
|
+ //设置状态中的各种值
|
|
|
+ _this.$store.commit('setIsLogin', storageState.isLogin);
|
|
|
+ _this.$store.commit('setToken', storageState.tnToken);
|
|
|
+ _this.$store.commit('setAvatar', storageState.avatar);
|
|
|
+ _this.$store.commit('setName', storageState.name);
|
|
|
+ _this.$store.commit('setIntroduction', storageState.introduction);
|
|
|
+ _this.$store.commit('setRoles', storageState.roles);
|
|
|
+ _this.$store.commit('setUser', storageState.user);
|
|
|
+ _this.$store.commit('setStationName', storageState.stationName);
|
|
|
+ _this.$store.commit('setStationCode', storageState.stationCode);
|
|
|
+ _this.$store.commit('setDepartmentName', storageState.departmentName);
|
|
|
+ _this.$store.commit('setDepartmentCode', storageState.departmentCode);
|
|
|
+ _this.$store.commit('setProjectCode', storageState.projectCode);
|
|
|
}
|
|
|
/* 获取状态值 */
|
|
|
function getState(_this,key){
|
|
|
let storageState=uni.getStorageSync("storage_state");
|
|
|
+ console.info('storageState',storageState);
|
|
|
if(key==='isLogin'){
|
|
|
if(!_this.$store.state.isLogin){
|
|
|
if(storageState){
|