sc
This commit is contained in:
@@ -18,6 +18,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
const avatar = ref(storage.get(constant.avatar));
|
||||
const roles = ref(storage.get(constant.roles));
|
||||
const permissions = ref(storage.get(constant.permissions));
|
||||
const userMenus = ref([]);
|
||||
|
||||
const SET_TOKEN = val => {
|
||||
token.value = val;
|
||||
@@ -77,6 +78,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
const userid = isEmpty(user) || isEmpty(user.id) ? '' : user.id;
|
||||
const username = isEmpty(user) || isEmpty(user.nickname) ? '' : user.nickname;
|
||||
const role = isEmpty(user) || isEmpty(user.currentRole) ? '' : user.currentRole;
|
||||
userMenus.value = res.data.menus || [];
|
||||
if (res.data.roles && res.data.roles.length > 0) {
|
||||
SET_ROLES(res.data.roles);
|
||||
SET_PERMISSIONS(res.data.permissions);
|
||||
@@ -121,6 +123,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
currentRole,
|
||||
avatar,
|
||||
roles,
|
||||
userMenus,
|
||||
permissions,
|
||||
SET_AVATAR,
|
||||
login: loginAction,
|
||||
|
||||
Reference in New Issue
Block a user