Commit ce9f5690 authored by 李纪文's avatar 李纪文

Merge branch 'dev-cloud' into 'master'

fix: 退出client为undefined See merge request !8
parents 591c803b 740e4d95
Pipeline #46104 skipped with stages
...@@ -60,7 +60,8 @@ export const initGlobalConfig = () => { ...@@ -60,7 +60,8 @@ 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') || Cookies.get('city') let client = params.getParams('client') || Cookies.get('city')
client = client && client !== 'undefined' ? client : 'city';
appService appService
.queryConfig({ .queryConfig({
client: client || 'city', client: client || 'city',
...@@ -72,7 +73,7 @@ export const initGlobalConfig = () => { ...@@ -72,7 +73,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') || Cookies.get('city'); data.client = client;
} }
// Cookies.set('city', data.client); // Cookies.set('city', data.client);
store.dispatch( store.dispatch(
......
...@@ -360,7 +360,7 @@ const BasicLayout = props => { ...@@ -360,7 +360,7 @@ const BasicLayout = props => {
useEffect(() => { useEffect(() => {
siteAction.setGlobalConfig(props.global); siteAction.setGlobalConfig(props.global);
if (!Cookies.get('token')) { if (!Cookies.get('token')) {
let client = props.global && props.global.client; let client = props.global && props.global.hasOwnProperty('client') ? props.global.get('client') : null;
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client: 'city'; client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client: 'city';
let generateType = props.global && props.global.hasOwnProperty('get') ? props.global.get('generateType') : null; let generateType = props.global && props.global.hasOwnProperty('get') ? props.global.get('generateType') : null;
generateType = !_.isNull(generateType) && !_.isUndefined(generateType) && generateType !== 'undefined' ? `&generateType=${generateType}` : ''; generateType = !_.isNull(generateType) && !_.isUndefined(generateType) && generateType !== 'undefined' ? `&generateType=${generateType}` : '';
......
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