提交 c6b3fd8d 编写于 作者: KK's avatar KK

权限注释

上级 81704130
...@@ -71,26 +71,27 @@ export class AuthGuard { ...@@ -71,26 +71,27 @@ export class AuthGuard {
* @memberof AuthGuard * @memberof AuthGuard
*/ */
public async authGuard(url: string, params: any = {}, store: Store<any>): Promise<any> { public async authGuard(url: string, params: any = {}, store: Store<any>): Promise<any> {
const response: any = await Http.getInstance().get(url); // const response: any = await Http.getInstance().get(url);
if (response && response.status === 200) { // if (response && response.status === 200) {
let { data }: { data: any } = response; // let { data }: { data: any } = response;
if (data) { // if (data) {
// token认证把用户信息放入应用级数据 // // token认证把用户信息放入应用级数据
if (localStorage.getItem('user')) { // if (localStorage.getItem('user')) {
let user: any = JSON.parse(localStorage.getItem('user') as string); // let user: any = JSON.parse(localStorage.getItem('user') as string);
let localAppData: any = {}; // let localAppData: any = {};
if (user.sessionParams) { // if (user.sessionParams) {
localAppData = { context: user.sessionParams }; // localAppData = { context: user.sessionParams };
Object.assign(localAppData, data); // Object.assign(localAppData, data);
} // }
data = JSON.parse(JSON.stringify(localAppData)); // data = JSON.parse(JSON.stringify(localAppData));
} // }
store.commit('addAppData', data); // store.commit('addAppData', data);
// 提交统一资源数据 // // 提交统一资源数据
store.dispatch('authresource/commitAuthData', data); // store.dispatch('authresource/commitAuthData', data);
} // }
} // }
return await this.loadDictionaryDatas(store); // return await this.loadDictionaryDatas(store);
return true;
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册