| | |
| | | // 用户信息状态管理 |
| | | import { update } from 'lodash' |
| | | import { defineStore } from 'pinia' |
| | | import { UserInfo } from '@/stores/interface' |
| | | import router from '@/router/index' |
| | | |
| | | export const useUserInfo = defineStore('userInfo', { |
| | | state: (): UserInfo => { |
| | |
| | | empCode:'', |
| | | userId:'', |
| | | unitId:'',//租户ID |
| | | departmentId: '', |
| | | roleCodes:[], |
| | | userInfo:{ |
| | | adminToken: '', // 管理后台的token |
| | |
| | | this.fullUnitName = user.fullUnitName |
| | | this.userId = user.id |
| | | this.unitId = user.unitId |
| | | this.departmentId = user.departmentId |
| | | this.roleCodes = user.roleCodes |
| | | this.userInfo=user |
| | | }, |
| | |
| | | getUnitId: (state) => { |
| | | return state.unitId |
| | | }, |
| | | getDepartmentId: (state) => { |
| | | return state.departmentId |
| | | }, |
| | | getRoleCodes: (state) => { |
| | | return state.roleCodes |
| | | }, |