This commit is contained in:
Taric Xin
2021-12-20 10:07:52 +08:00
parent 46fb4d51e8
commit 91dcc20d9a
2 changed files with 10 additions and 5 deletions

View File

@ -12,7 +12,7 @@ export class DunHelper {
userInfo; userInfo;
constructor(private overlay: Overlay) { constructor(private overlay: Overlay) {
this.userInfo = JSON.parse(localStorage.getItem('user') || ''); this.userInfo = JSON.parse(localStorage.getItem('user') || '{}');
} }
/** /**

View File

@ -125,7 +125,7 @@ export class EAUserService extends BaseService {
async doAfterLogin() { async doAfterLogin() {
await this.loadUserInfo(); await this.loadUserInfo();
// await this.loadUserMenus(); await this.loadUserMenus();
await this.loadUserRoles(); await this.loadUserRoles();
} }
@ -143,9 +143,14 @@ export class EAUserService extends BaseService {
* 加载用户菜单 * 加载用户菜单
*/ */
async loadUserMenus() { async loadUserMenus() {
return this.asyncRequest(this.$api_get_user_menus, { appId: sysConf.appId }).then(res => { // return this.asyncRequest(this.$api_get_user_menus, { appId: sysConf.appId }).then(res => {
this.cacheSrv.set(cacheConf.menu, res); // this.cacheSrv.set(cacheConf.menu, res);
}); // });
this.request('assets/mocks/menu-data.json').pipe(
map((res: any) => {
this.cacheSrv.set(cacheConf.menu, res.menu);
})
);
} }
/** /**