Commit a753f7f7 authored by 曾婧's avatar 曾婧
parents c79783a1 35442c9e
Pipeline #48628 passed with stages
in 2 minutes 19 seconds
......@@ -45,8 +45,7 @@ const ArrowIcon = props => <Icon component={arrowSvg} {...props} />;
const optionsWith = [{ label: '按站点', value: 'site' }, { label: '按城市', value: 'city' }];
const HOT = ['HOT', '县', '市', 'New'];
const StationsItem = (item, action, onChangeVisible) => {
const changeGroup = (event, data) => {
debugger;
const changeGroup = (event, data) => {
action.changeGroup && action.changeGroup(event, data, onChangeVisible);
};
return (
......@@ -191,7 +190,9 @@ const Layout = props => {
const history = useHistory();
useEffect(() => {
siteAction.setGlobalConfig(props.global);
if (!Cookies.get('token')) {
const tk = Cookies.get('token') || props.global.token;
const isLogin = tk !== null && tk !== 'undefined' && tk !== (void 0);
if (!isLogin) {
let client = props.global && props.global.hasOwnProperty('client') ? props.global.get('client') : null;
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client : 'city';
let generateType = props.global && props.global.hasOwnProperty('get') ? props.global.get('generateType') : null;
......@@ -231,7 +232,6 @@ const Layout = props => {
useEffect(() => {
window.share.event.on('updateSite', res => {
debugger;
setCityData(res);
});
return () => {
......
......@@ -45,8 +45,8 @@ class SecurityLayout extends React.Component {
render() {
const { isReady } = this.state;
const { children, global, loading } = this.props;
const isLogin = Cookies.get('token') !== null && global.token !== null;
const tk = Cookies.get('token') || global.token;
const isLogin = tk !== null && tk !== 'undefined' && tk !== (void 0);
if (!isLogin && window.location.pathname !== '/civbase/user/login') {
const { query = {}, search, pathname } = history.location;
const { redirect } = query;
......@@ -54,7 +54,7 @@ class SecurityLayout extends React.Component {
// redirect: pathname + search,
// });
this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
let client = global.client || Cookies.get('city');
let client = global.client || Cookies.get('client');
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client : 'city';
let { generateType } = global;
generateType = !_.isNull(generateType) && !_.isUndefined(generateType) && generateType !== 'undefined' ? `&generateType=${generateType}` : '';
......
......@@ -361,6 +361,10 @@ class Site {
window.share && window.share.event && window.share.event.emit('reloadNotice');
const config = self.globalConfig;
let url = !config.home ? ((config.homepage === '' || _.isNull(config.homepage)) ? `/civweb4`: `/civweb4/${config.homepage.replace(/^\//, '').replace(/^civweb4\//, '')}`) : `/${config.homepage.replace(/^\//, '')}`;
// 在云平台上,切换前后如果url一致会出问题
if(config.userInfo && config.userInfo.site) {
url += `${url.indexOf('|') > -1 ? '&' : '|' }__site__=${config.userInfo.site}`;
}
self.props.history && self.props.history.push(url);
self.props && self.props.updateCollapsed && self.props.updateCollapsed(false);
window.share.event.emit('triggerMicro', this.props.global);
......
......@@ -914,7 +914,6 @@ class Login {
const self = this;
const token = response && ( response.token ? response.token: ( response.access_token !== null && response.user_token !== null) ? response.user_token: '');
if (token) {
Cookies.set('token', token);
const exp = 86400000;
self.globalConfig.token = token;
if(response.access_token!== "") {
......
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