Browse Source

修改多部门登录时bug

dev
long 2 years ago
parent
commit
35761b66dd
  1. 15
      src/store/modules/user.js
  2. 11
      src/views/user/LoginSelectTenant.vue

15
src/store/modules/user.js

@ -137,13 +137,20 @@ const user = {
const parentId=response.result.parentId; const parentId=response.result.parentId;
const puwwcId=response.result.puwwcId; const puwwcId=response.result.puwwcId;
const userInformation=response.result.userInfo; const userInformation=response.result.userInfo;
console.log('------>登录后的信息',response)
//Vue.ls.set(USER_AUTH,authData); //Vue.ls.set(USER_AUTH,authData);
sessionStorage.setItem(USER_AUTH,JSON.stringify(authData)); sessionStorage.setItem(USER_AUTH,JSON.stringify(authData));
sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData)); sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData));
sessionStorage.setItem(PARENT_ID,parentId); if (!sessionStorage.getItem(PARENT_ID)){
sessionStorage.setItem(PUWWC_Id,puwwcId); sessionStorage.setItem(PARENT_ID,parentId);
sessionStorage.setItem(USER_INFORMATION,JSON.stringify(userInformation)); }
if (!sessionStorage.getItem(PUWWC_Id)){
sessionStorage.setItem(PUWWC_Id,puwwcId);
}
if (Vue.ls.get(USER_INFO)){
sessionStorage.setItem(USER_INFORMATION,JSON.stringify(Vue.ls.get(USER_INFO)));
}else {
sessionStorage.setItem(USER_INFORMATION,JSON.stringify(userInformation));
}
sessionStorage.setItem('ASIDE_MEAN',JSON.stringify(menuData)); sessionStorage.setItem('ASIDE_MEAN',JSON.stringify(menuData));
if (menuData && menuData.length > 0) { if (menuData && menuData.length > 0) {
//update--begin--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------ //update--begin--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------

11
src/views/user/LoginSelectTenant.vue

@ -52,7 +52,7 @@
import Vue from 'vue' import Vue from 'vue'
import { getAction,putAction } from '@/api/manage' import { getAction,putAction } from '@/api/manage'
import { USER_INFO } from "@/store/mutation-types" import { USER_INFO,PARENT_ID,PUWWC_Id } from "@/store/mutation-types"
import store from './Login' import store from './Login'
export default { export default {
@ -159,10 +159,17 @@
} }
putAction("/sys/selectDepart",obj).then(res=>{ putAction("/sys/selectDepart",obj).then(res=>{
if(res.success){ if(res.success){
console.log(res.result,"切换部门")
const userInfo = res.result.userInfo; const userInfo = res.result.userInfo;
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000); Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000);
this.$store.commit('SET_INFO', userInfo); this.$store.commit('SET_INFO', userInfo);
//console.log("------userInfo-------",store.getters.userInfo.orgCode); const parentId=res.result.parentId;
sessionStorage.setItem(PARENT_ID,parentId);
if (res.result.puwwcId){
console.log(res.result.puwwcId)
const puwwcId=res.result.puwwcId;
sessionStorage.setItem('PUWWC_Id',puwwcId);
}
resolve(); resolve();
}else{ }else{
this.requestFailed(res) this.requestFailed(res)

Loading…
Cancel
Save