Commit 81b90a4e authored by 张瑶's avatar 张瑶

fix:云平台兼容

parent 37f7c768
Pipeline #86365 waiting for manual action with stages
...@@ -64,14 +64,17 @@ class Login { ...@@ -64,14 +64,17 @@ class Login {
if (res.success === 'OK') { if (res.success === 'OK') {
const tk = res.token; const tk = res.token;
self.globalConfig.token = tk; self.globalConfig.token = tk;
getUserInfo( let param = {
{ subOID: 'subOID',
identity: tk, site: this.getLocalSiteBytoken(tk),
subOID: 'subOID', ignoreSite: true,
site: this.getLocalSiteBytoken(tk), };
ignoreSite: true, if (window.location?.host === 'panda-water.cn') {
}, param.token = tk;
) } else {
param.identity = tk;
}
getUserInfo(param)
.then(response => { .then(response => {
try { try {
if (response && response.code === 0) { if (response && response.code === 0) {
...@@ -251,13 +254,18 @@ class Login { ...@@ -251,13 +254,18 @@ class Login {
this.globalConfig.token = token; this.globalConfig.token = token;
const self = this; const self = this;
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
getUserInfo({ let param = {
identity: this.globalConfig.token,
subOID: 'subOID', subOID: 'subOID',
site: noTokenSite ?? this.getLocalSiteBytoken(token), site: noTokenSite ?? this.getLocalSiteBytoken(token),
'request.preventCache': Date.now(), 'request.preventCache': Date.now(),
ignoreSite: true, ignoreSite: true,
}) };
if (window.location?.host === 'panda-water.cn') {
param.token = this.globalConfig.token;
} else {
param.identity = this.globalConfig.token;
}
getUserInfo(param)
.then(response => { .then(response => {
if (response && response.code === 0) { if (response && response.code === 0) {
self.globalConfig.userInfo = window?.globalConfig?.transformUserInfo?.(response.data) ?? {}; self.globalConfig.userInfo = window?.globalConfig?.transformUserInfo?.(response.data) ?? {};
...@@ -997,13 +1005,18 @@ class Login { ...@@ -997,13 +1005,18 @@ class Login {
const tk = response.token; const tk = response.token;
self.globalConfig.token = tk; self.globalConfig.token = tk;
// eslint-disable-next-line no-undef,no-debugger // eslint-disable-next-line no-undef,no-debugger
let param = {
subOID: 'subOID',
site: this.getLocalSiteBytoken(tk),
ignoreSite: true,
};
if (window.location?.host === 'panda-water.cn') {
param.token = tk;
} else {
param.identity = tk;
}
getUserInfo( getUserInfo(
{ param,
identity: tk,
subOID: 'subOID',
site: this.getLocalSiteBytoken(tk),
ignoreSite: true,
},
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
) )
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
...@@ -1112,8 +1125,7 @@ class Login { ...@@ -1112,8 +1125,7 @@ class Login {
} }
if (self.isSignIn || !!industry) { if (self.isSignIn || !!industry) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
getUserInfo({ let param = {
identity: token,
subOID: 'subOID', subOID: 'subOID',
industry, industry,
site: _industrySite || this.getLocalSiteBytoken(token), site: _industrySite || this.getLocalSiteBytoken(token),
...@@ -1121,7 +1133,13 @@ class Login { ...@@ -1121,7 +1133,13 @@ class Login {
'request.preventCache': Date.now(), 'request.preventCache': Date.now(),
// self.globalConfig.userInfo.site ? self.globalConfig.userInfo.site: this.getLocalSiteBytoken(token), // self.globalConfig.userInfo.site ? self.globalConfig.userInfo.site: this.getLocalSiteBytoken(token),
// industrySite ? _industrySite : this.getLocalSiteBytoken(token), // industrySite ? _industrySite : this.getLocalSiteBytoken(token),
}) };
if (window.location?.host === 'panda-water.cn') {
param.token = token;
} else {
param.identity = token;
}
getUserInfo(param)
.then(response => { .then(response => {
try { try {
if (response && response.code === 0) { if (response && response.code === 0) {
......
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