Commit e013e05f authored by 崔佳豪's avatar 崔佳豪

perf: 兼容网关服务失败

parent e7a52fa6
Pipeline #48421 passed with stages
in 2 minutes 26 seconds
......@@ -49,19 +49,8 @@ export const initGlobalConfig = () => {
// }
let client = params.getParams('client') || Cookies.get('city');
client = client && client !== 'undefined' ? client : 'city';
appService
.getWateWayConfig({
ignoreSite: true,
})
.then(res => {
/* eslint-disable */
const hasGateWay = !res || !res.data ? false : _.isString(res.data) ? JSON.parse(res.data) : typeof res.data === 'boolean' ? res.data : false;
return {
hasGateWay,
apiGatewayDomain: `${window.location.origin}${hasGateWay ? '/PandaCore/GateWay' : ''}`,
};
})
.then(gateWayConfig => {
const queryConfig = (gateWayConfig = {}) => {
appService
.queryConfig({
client: client || 'city',
......@@ -130,5 +119,23 @@ export const initGlobalConfig = () => {
.catch(error => {
store.dispatch(actionCreators.getConfigError(error));
});
}
appService
.getWateWayConfig({
ignoreSite: true,
})
.then(res => {
/* eslint-disable */
const hasGateWay = !res || !res.data ? false : _.isString(res.data) ? JSON.parse(res.data) : typeof res.data === 'boolean' ? res.data : false;
return {
hasGateWay,
apiGatewayDomain: `${window.location.origin}${hasGateWay ? '/PandaCore/GateWay' : ''}`,
};
})
.then(gateWayConfig => {
queryConfig(gateWayConfig);
})
.catch(err => {
queryConfig();
});
};
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