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

appdata请求

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