Commit 2449af24 authored by 周宏民's avatar 周宏民

fix: 丹棱登录页跳转bug

parent f9e6a310
Pipeline #95969 passed with stages
...@@ -26,29 +26,29 @@ import qrcodePng from './images/1.png'; ...@@ -26,29 +26,29 @@ import qrcodePng from './images/1.png';
import bg from './images/DL-BG.jpg'; import bg from './images/DL-BG.jpg';
const PopOvercontent = () => { const PopOvercontent = () => {
const qrcodes = window.globalConfig && window.globalConfig.qrcode; const qrcodes = window.globalConfig && window.globalConfig.qrcode;
if (qrcodes) { if (qrcodes) {
return <QRCode value={qrcodes} />; return <QRCode value={qrcodes} />;
} }
return <span>手持APP下载未配置</span>; return <span>手持APP下载未配置</span>;
}; };
const Login = forwardRef((props, _ref) => { const Login = forwardRef((props, _ref) => {
const sliVerify = useRef(); const sliVerify = useRef();
const loginFormRef = useRef(); const loginFormRef = useRef();
const formRef = useRef(null); const formRef = useRef(null);
const [status, setStatus] = useState('normal'); const [status, setStatus] = useState('normal');
const [show, setShow] = useState(false); const [show, setShow] = useState(false);
const [autoLogin, setAutoLogin] = useState(false); const [autoLogin, setAutoLogin] = useState(false);
const [submitting, setSubmitting] = useState(false); const [submitting, setSubmitting] = useState(false);
const [type, setType] = useState('Account'); const [type, setType] = useState('Account');
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const history = useHistory(); const history = useHistory();
const [action, setAction] = useState(() => new LoginAction(Object.assign({}, props, { history }), setVisible, false)); const [action, setAction] = useState(() => new LoginAction(Object.assign({}, props, { history }), setVisible, false));
const [dateObj, setDateObj] = useState({}); const [dateObj, setDateObj] = useState({});
const handleSubmit = values => { const handleSubmit = values => {
/* eslint-disable */ /* eslint-disable */
action && action &&
(type === 'Account' (type === 'Account'
? action.loginHandler(values.userName, values.password, null, autoLogin, sliVerify) ? action.loginHandler(values.userName, values.password, null, autoLogin, sliVerify)
...@@ -78,10 +78,18 @@ const Login = forwardRef((props, _ref) => { ...@@ -78,10 +78,18 @@ const Login = forwardRef((props, _ref) => {
action.events.on('loginVisible', status => { action.events.on('loginVisible', status => {
setVisible(status); setVisible(status);
}); });
action.events.on('loginHomePage', () => {
props.history.push(`/homePage`);
});
action.events.on('loginIndustry', () => {
props.history.push(`/industry`);
});
return () => { return () => {
action && action.events && action.events.removeAllListeners('loginSuccess'); action && action.events && action.events.removeAllListeners('loginSuccess');
action && action.events && action.events.removeAllListeners('loginError'); action && action.events && action.events.removeAllListeners('loginError');
action && action.events && action.events.removeAllListeners('loginVisible'); action && action.events && action.events.removeAllListeners('loginVisible');
action && action.events && action.events.removeAllListeners('loginHomePage');
action && action.events && action.events.removeAllListeners('loginIndustry');
}; };
}, [props.loginMode]); }, [props.loginMode]);
......
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