Commit 6dfdec6f authored by 李纪文's avatar 李纪文

fix: 修改访问其它网站配置获取city问题

parent 068dbe86
Pipeline #44143 passed with stages
in 1 minute 59 seconds
import { appService } from './api'; import { appService } from './api';
import { initMicroApps } from './micro'; import { initMicroApps } from './micro';
import { params, Storeage } from 'kit_utils'; import { params, Storeage } from 'kit_utils';
import Cookies from 'js-cookie';
import { actionCreators } from './containers/App/store'; import { actionCreators } from './containers/App/store';
import { getToken, isString } from './utils/utils'; import { getToken, isString } from './utils/utils';
import loader, { render } from './render'; import loader, { render } from './render';
...@@ -59,7 +60,7 @@ export const initGlobalConfig = () => { ...@@ -59,7 +60,7 @@ export const initGlobalConfig = () => {
} }
}); });
// eslint-disable-next-line react-hooks/rules-of-hooks // eslint-disable-next-line react-hooks/rules-of-hooks
const client = params.getParams('client') const client = params.getParams('client') || Cookies.get('city')
appService appService
.queryConfig({ .queryConfig({
client: client || 'city', client: client || 'city',
...@@ -70,7 +71,7 @@ export const initGlobalConfig = () => { ...@@ -70,7 +71,7 @@ export const initGlobalConfig = () => {
store.dispatch(actionCreators.getConfig(Object.assign({}))); store.dispatch(actionCreators.getConfig(Object.assign({})));
const data = res; const data = res;
if (!data.client) { if (!data.client) {
data.client = params.getParams('client') || 'city'; data.client = params.getParams('client') || Cookies.get('city');
} }
// Cookies.set('city', data.client); // Cookies.set('city', data.client);
store.dispatch( store.dispatch(
......
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