Commit feecce34 authored by 杨思琦's avatar 杨思琦

fix: 修复client

parent df7457e1
Pipeline #64571 passed with stages
......@@ -98,7 +98,8 @@ class Login {
site: this.getLocalSiteBytoken(token),
'request.preventCache': Date.now(),
ignoreSite: true,
}).then(response => {
})
.then(response => {
if (response && response.code === 0) {
self.globalConfig.userInfo = window?.globalConfig?.transformUserInfo?.(response.data) ?? {};
self.updateConfig && self.updateConfig(self.globalConfig);
......@@ -116,6 +117,10 @@ class Login {
}
window.location.reload();
}
})
.catch(error => {
this.handleLoginError();
Logger.log('获取用户配置失败');
});
}
......@@ -182,7 +187,6 @@ class Login {
getWebConfig(token, getIndustry) {
const self = this;
// eslint-disable-next-line no-undef
// 获取网站配置的同时,预先获取到mqtt配置,注册进子应用
Promise.all([
noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }),
......@@ -701,11 +705,16 @@ class Login {
self.updateConfig && self.updateConfig(self.globalConfig);
} catch (error) {
console.log(error);
message.error('登录失败');
if (self.goLogin()) {
return false;
}
// self.handleLoginError(failCallback);
}
})
.catch(error => {
this.handleLoginError();
Logger.log('获取用户配置失败');
});
} else {
self.handleLoginError();
......
......@@ -60,7 +60,9 @@ export const AppInitState = () => {
};
const client = getClient();
if (sessionStorage.getItem('client') && sessionStorage.getItem('client') !== client) {
sessionStorage.setItem('client', client);
}
let config = window.globalConfig || {};
// eslint-disable-next-line no-undef, no-restricted-globals
createStoreage.remove(`__PANDA_STORE__${location.hostname}`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment