Skip to content

Commit

Permalink
fix(用户登录): 用户登录重定向问题
Browse files Browse the repository at this point in the history
重定向参数错误导致一次登录不会成功
  • Loading branch information
Lind-pro committed Sep 23, 2020
1 parent 29d2b30 commit d4426f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/layouts/SecurityLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const SecurityLayout = (props: SecurityLayoutProps) => {
}
if (!isLogin) {
// TODO 此处应使用注释的代码。但跳转存在问题,
return <Redirect to={`/user/login?${queryString}`} />;
// return <Redirect to="/user/login"></Redirect>;
// return <Redirect to={`/user/login?${queryString}`} />;
return <Redirect to="/user/login"></Redirect>;
}
return children;
}
Expand Down
16 changes: 10 additions & 6 deletions src/pages/user/login2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ const Login: React.FC<Props> = props => {
setEnable(resp.enabled)
if (resp.enabled) {
//获取验证码
// service.getCaptcha().subscribe((resp) => {
// setCaptcha(resp.key);
// setCaptchaImg(resp.base64);
// });
getCodeImg();
service.getCaptcha().subscribe((resp) => {
setCaptcha(resp.key);
setCaptchaImg(resp.base64);
});
// getCodeImg();
} else {
//未开启验证码
}
Expand All @@ -88,8 +88,12 @@ const Login: React.FC<Props> = props => {
<div className={style.bg1} />
<div className={style.gyl}>
物联网平台
<div className={style.gy2}>MQTT TCP CoAP HTTP , 多消息协议适配 , 可视化规则引擎</div>
<div className={style.gy2}>MQTT TCP CoAP HTTP , 多消息协议适配 , 可视化规则引擎
{captcha},{code}

</div>
</div>

<div className={style.box} style={{ height: enable ? '387px' : '330px' }}>
<div className={style.header}>用户登录</div>

Expand Down

0 comments on commit d4426f5

Please sign in to comment.