Commit fb5a4a41 authored by 邓晓峰's avatar 邓晓峰

fix: client获取错误问题

parent 155cabe6
Pipeline #33555 passed with stages
in 60 minutes 53 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
"immutable": "^4.0.0-rc.12", "immutable": "^4.0.0-rc.12",
"js-base64": "^3.5.2", "js-base64": "^3.5.2",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"kit_global_config": "^1.0.29", "kit_global_config": "^1.0.30",
"kit_logger": "^1.0.2", "kit_logger": "^1.0.2",
"kit_utils": "^1.3.11", "kit_utils": "^1.3.11",
"lodash": "4.17.11", "lodash": "4.17.11",
......
...@@ -45,6 +45,7 @@ import { ...@@ -45,6 +45,7 @@ import {
isString, isString,
} from './utils/utils'; } from './utils/utils';
import './utils/event'; import './utils/event';
import Cookies from 'js-cookie';
const isHttps = document.location.protocol === 'https:'; const isHttps = document.location.protocol === 'https:';
const { pwa } = defaultSettings; const { pwa } = defaultSettings;
// eslint-disable-next-line no-restricted-globals // eslint-disable-next-line no-restricted-globals
...@@ -128,9 +129,8 @@ const initGlobalConfig = () => { ...@@ -128,9 +129,8 @@ const initGlobalConfig = () => {
}); });
// eslint-disable-next-line react-hooks/rules-of-hooks // eslint-disable-next-line react-hooks/rules-of-hooks
appService appService
.queryConfig({ client: params.getParams('client') || 'city' }) .queryConfig({ client: params.getParams('client') || Cookies.get('city') || 'city' })
.then(res => { .then(res => {
debugger;
if (res) { if (res) {
const data = res; const data = res;
if (!data.client) { if (!data.client) {
......
...@@ -105,6 +105,7 @@ const appReducer = (state = initialState, action) => { ...@@ -105,6 +105,7 @@ const appReducer = (state = initialState, action) => {
} }
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const flatMenu = generFlatRoutes(generMenu || []); const flatMenu = generFlatRoutes(generMenu || []);
Cookies.set('city', Cookies.get('city') || window.globalConfig.client);
return state.merge({ return state.merge({
globalConfig: config, globalConfig: config,
menu: generMenu, menu: generMenu,
......
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