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

fix: loginMode 存入cookie失败

parent 324999fb
Pipeline #48410 passed with stages
in 2 minutes 19 seconds
...@@ -6,8 +6,9 @@ import { Helmet, HelmetProvider } from 'react-helmet-async'; ...@@ -6,8 +6,9 @@ import { Helmet, HelmetProvider } from 'react-helmet-async';
import classNames from 'classnames'; import classNames from 'classnames';
import { dom } from '@wisdom-utils/utils/lib/helpers'; import { dom } from '@wisdom-utils/utils/lib/helpers';
import { useHistory, withRouter } from '@wisdom-utils/runtime'; import { useHistory, withRouter } from '@wisdom-utils/runtime';
import Cookies from 'js-cookie';
import { actionCreators } from '@/containers/App/store'; import { actionCreators } from '@/containers/App/store';
import { LOGIN_WAY } from '@/constants'; import { LOGIN_WAY, LOGIN_DISPLAY } from '@/constants';
import defaultSetting from '../../../../../../config/defaultSetting'; import defaultSetting from '../../../../../../config/defaultSetting';
import LoginAction from '../../login'; import LoginAction from '../../login';
import styles from './index.less'; import styles from './index.less';
...@@ -17,7 +18,6 @@ import IotComponent from '../../js/useIOTComponent'; ...@@ -17,7 +18,6 @@ import IotComponent from '../../js/useIOTComponent';
import CloudForm from './cloudForm'; import CloudForm from './cloudForm';
import { initMicroApps } from '../../../../../micro'; import { initMicroApps } from '../../../../../micro';
import useTime from '../../js/useTime'; import useTime from '../../js/useTime';
import { LOGIN_DISPLAY } from '../../../../../constants';
const isRQcodeFunc = loginFunc => { const isRQcodeFunc = loginFunc => {
const rqcodeFuncs = [LOGIN_DISPLAY.WeChart, LOGIN_DISPLAY.WeCom]; const rqcodeFuncs = [LOGIN_DISPLAY.WeChart, LOGIN_DISPLAY.WeCom];
...@@ -25,9 +25,9 @@ const isRQcodeFunc = loginFunc => { ...@@ -25,9 +25,9 @@ const isRQcodeFunc = loginFunc => {
}; };
const loginFuncImg = loginFunc => { const loginFuncImg = loginFunc => {
if (isRQcodeFunc(loginFunc)) { if (isRQcodeFunc(loginFunc)) {
return require('@/assets/images/login/cloud/func_rqcode.png');
}
return require('@/assets/images/login/cloud/func_pwd.png'); return require('@/assets/images/login/cloud/func_pwd.png');
}
return require('@/assets/images/login/cloud/func_rqcode.png');
}; };
const Login = forwardRef((props, _ref) => { const Login = forwardRef((props, _ref) => {
...@@ -150,7 +150,7 @@ const Login = forwardRef((props, _ref) => { ...@@ -150,7 +150,7 @@ const Login = forwardRef((props, _ref) => {
const toggleLoginFunc = e => { const toggleLoginFunc = e => {
e && e.stopPropagation && e.stopPropagation(); e && e.stopPropagation && e.stopPropagation();
setType(isRQcodeFunc(type) ? LOGIN_DISPLAY.Account : LOGIN_DISPLAY.WeCom); setType(isRQcodeFunc(type) ? LOGIN_DISPLAY.Account : LOGIN_DISPLAY.WeCom);
props.updateLoginMode(isRQcodeFunc(type) ? LOGIN_WAY[LOGIN_DISPLAY.Account] : LOGIN_WAY[LOGIN_DISPLAY.WeCom]) props.updateLoginMode(isRQcodeFunc(type) ? LOGIN_WAY[LOGIN_DISPLAY.Account] : LOGIN_WAY[LOGIN_DISPLAY.WeCom]);
Cookies.set('loginMode', isRQcodeFunc(type) ? LOGIN_WAY[LOGIN_DISPLAY.Account] : LOGIN_WAY[LOGIN_DISPLAY.WeCom], { Cookies.set('loginMode', isRQcodeFunc(type) ? LOGIN_WAY[LOGIN_DISPLAY.Account] : LOGIN_WAY[LOGIN_DISPLAY.WeCom], {
expires: 5 * 60 * 1000, expires: 5 * 60 * 1000,
path: '/', path: '/',
......
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