|
@@ -149,6 +149,7 @@ export const useUserStore = defineStore({
|
|
if (!this.getToken) return null;
|
|
if (!this.getToken) return null;
|
|
const userInfo = await getUserInfo();
|
|
const userInfo = await getUserInfo();
|
|
const { roleId, agent = null } = userInfo;
|
|
const { roleId, agent = null } = userInfo;
|
|
|
|
+ console.log('getUserInfoAction', roleId, agent);
|
|
this.setAgent(agent);
|
|
this.setAgent(agent);
|
|
if (isArray(roleId)) {
|
|
if (isArray(roleId)) {
|
|
const roleList = roleId.map((item) => item.value) as RoleEnum[];
|
|
const roleList = roleId.map((item) => item.value) as RoleEnum[];
|
|
@@ -158,6 +159,7 @@ export const useUserStore = defineStore({
|
|
this.setRoleList([RoleEnum.SUPER, RoleEnum.TEST]);
|
|
this.setRoleList([RoleEnum.SUPER, RoleEnum.TEST]);
|
|
} else if (agent) {
|
|
} else if (agent) {
|
|
const myRoles = agent.agentLevel == 2 ? RoleEnum.DISTRIBUTOR : RoleEnum.TEST;
|
|
const myRoles = agent.agentLevel == 2 ? RoleEnum.DISTRIBUTOR : RoleEnum.TEST;
|
|
|
|
+ console.log('agent', agent, myRoles);
|
|
userInfo.roles = [myRoles];
|
|
userInfo.roles = [myRoles];
|
|
this.setRoleList([myRoles]);
|
|
this.setRoleList([myRoles]);
|
|
} else {
|
|
} else {
|