马宇豪
2023-03-22 22bf644b3fc85763be3ad0c5e348d2bee38e2444
src/stores/userInfo.ts
@@ -1,7 +1,6 @@
import { defineStore } from 'pinia';
import Cookies from 'js-cookie';
import { UserInfosStates } from './interface';
import { Session } from '/@/utils/storage';
/**
 * 用户信息
@@ -16,15 +15,18 @@
            roles: [],
            authBtnList: [],
            uid: '',
            depId: null,
            projectId: '',
            dataList: []
        }
    }),
    persist:true,
    actions: {
        async setUserInfos(value: any) {
            this.userInfos.userName = value.username;
            this.userInfos.userName = value.realName;
            this.userInfos.uid = value.uid;
            this.userInfos.roles = value.role;
            this.userInfos.depId = value.depId
            // const userName = Cookies.get('userName');
            // // 模拟数据
            // let defaultRoles: Array<string> = [];