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

fix: 未选中记住密码时仍然记住密码

parent a0f7a260
Pipeline #48610 skipped with stages
......@@ -46,7 +46,6 @@ const optionsWith = [{ label: '按站点', value: 'site' }, { label: '按城市'
const HOT = ['HOT', '县', '市', 'New'];
const StationsItem = (item, action, onChangeVisible) => {
const changeGroup = (event, data) => {
debugger;
action.changeGroup && action.changeGroup(event, data, onChangeVisible);
};
return (
......@@ -190,8 +189,9 @@ const Layout = props => {
// const basename = getBaseName();
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;
......
......@@ -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}` : '';
......
......@@ -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