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

fix: 用户名密码参数登录无法进入问题

parent c2faef1c
...@@ -59,27 +59,14 @@ const Login = forwardRef((props, _ref) => { ...@@ -59,27 +59,14 @@ const Login = forwardRef((props, _ref) => {
setSubmitting(true); setSubmitting(true);
props.updateCurrentIndex && props.updateCurrentIndex(-1); props.updateCurrentIndex && props.updateCurrentIndex(-1);
action && action.events.on('loginSuccess', event => {
setSubmitting(false);
props.updateCurrentIndex && props.updateCurrentIndex(0);
// props.history.push(`/`);
// debugger
// window.share.event.emit('triggerMicro', props.global);
initMicroApps();
});
action && action.events.on('loginError', event => {
setVisible(false);
setSubmitting(false);
});
action && action.events.on('loginVisible', status => {
setVisible(status);
});
}; };
useEffect(() => { useEffect(() => {
if (props.loginMode === LOGIN_WAY.WeChart) { // if (props.loginMode === LOGIN_WAY.WeChart) {
action && action &&
action.events.on('loginSuccess', event => { action.events.on('loginSuccess', event => {
setSubmitting(false);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.history.push(`/?client=${props.global.client}`); props.history.push(`/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global); // window.share.event.emit('triggerMicro', props.global);
initMicroApps(); initMicroApps();
...@@ -89,6 +76,15 @@ const Login = forwardRef((props, _ref) => { ...@@ -89,6 +76,15 @@ const Login = forwardRef((props, _ref) => {
setVisible(false); setVisible(false);
setSubmitting(false); setSubmitting(false);
}); });
action &&
action.events.on('loginVisible', status => {
setVisible(status);
});
// }
return () => {
action && action.events && action.events.removeAllListeners('loginSuccess');
action && action.events && action.events.removeAllListeners('loginError');
action && action.events && action.events.removeAllListeners('loginVisible');
} }
}, [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