| | |
| | | roles: [], |
| | | authBtnList: [], |
| | | clientCode:'', |
| | | clientName:'' |
| | | clientName:'', |
| | | clientInfos:[], |
| | | }, |
| | | }), |
| | | actions: { |
| | |
| | | const userCode = userRet.code |
| | | // 模拟数据 |
| | | let defaultRoles: Array<string> = []; |
| | | let defClients:Array<object>=[]; |
| | | let defaultAuthBtnList: Array<string> = []; |
| | | // admin 页面权限标识,对应路由 meta.roles,用于控制路由的显示/隐藏 |
| | | let adminRoles: Array<string> = ['admin']; |
| | |
| | | if (isadmin) { |
| | | defaultRoles = adminRoles; |
| | | defaultAuthBtnList = adminAuthBtnList; |
| | | defClients=userRet?.管理员能看到的客户列表 |
| | | |
| | | } else { |
| | | defaultRoles = testRoles; |
| | | defaultAuthBtnList = testAuthBtnList; |
| | | defClients=userRet.clientInfos |
| | | |
| | | } |
| | | // 用户信息模拟数据 |
| | | const userInfos = { |
| | |
| | | authBtnList: defaultAuthBtnList, |
| | | clientCode:userRet.currentClientInfo.code, |
| | | clientName:userRet.currentClientInfo.clientName, |
| | | clientInfos:defClients |
| | | }; |
| | | console.log('-----------------2222------------------------------') |
| | | console.log(defaultRoles) |
| | | console.log(userInfos) |
| | | // Session.set('userInfo', userInfos); |
| | | resolve(userInfos); |
| | | }, 0); |
| | | }); |
| | | }, |
| | | async setUserCilent(client:clientInfo){ |
| | | this.userInfos.clientCode=client.code |
| | | this.userInfos.clientName=client.clientName |
| | | } |
| | | }, |
| | | }); |