From a62221f4d15ea6dd09a433f91a9aae4835cfd9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=B8=80=E6=98=8E?= Date: Tue, 2 Jul 2019 13:47:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/account/LoginForm.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/account/LoginForm.jsx b/src/components/account/LoginForm.jsx index 8377eff..7968bbd 100644 --- a/src/components/account/LoginForm.jsx +++ b/src/components/account/LoginForm.jsx @@ -68,11 +68,11 @@ class LoginForm extends Component { ) } handleSubmit = (e) => { - let { history, onLogin } = this.props + let { location, history, onLogin } = this.props e.preventDefault() onLogin(this.state, () => { - let { pathname } = history.location - if (pathname !== '/account/login') history.push(pathname) // 如果用户在其他业务页面,则不跳转 + let { pathname, search} = location + if (pathname !== '/account/login') history.push(pathname + search) // 如果用户在其他业务页面,则不跳转 else history.push('/') // 跳转到用户面板 }) } From ef36ff2560259f38f80ffa10abaa52490fc84138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=B8=80=E6=98=8E?= Date: Tue, 2 Jul 2019 14:04:53 +0800 Subject: [PATCH 2/2] fix-style --- src/components/account/LoginForm.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/account/LoginForm.jsx b/src/components/account/LoginForm.jsx index 7968bbd..f79b61b 100644 --- a/src/components/account/LoginForm.jsx +++ b/src/components/account/LoginForm.jsx @@ -71,7 +71,7 @@ class LoginForm extends Component { let { location, history, onLogin } = this.props e.preventDefault() onLogin(this.state, () => { - let { pathname, search} = location + let {pathname, search} = location if (pathname !== '/account/login') history.push(pathname + search) // 如果用户在其他业务页面,则不跳转 else history.push('/') // 跳转到用户面板 })