From 570427fb2fc7aa0de0259bc16d1bb186af0dc26d Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 8 May 2023 09:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20=E9=87=8D?= =?UTF-8?q?=E5=86=99token=E6=88=AA=E5=8F=96=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/login.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/login/login.js b/src/pages/login/login.js index 55b3e9ae..be286731 100644 --- a/src/pages/login/login.js +++ b/src/pages/login/login.js @@ -17,7 +17,10 @@ export default class App extends Component { componentWillMount() { const tokenString = this.props.location.search; - const token = tokenString.substring(tokenString.indexOf('=') + 1); + const token = tokenString.substring( + tokenString.indexOf('=') + 1, + tokenString.indexOf('&') + ); /* 判断是否有token */ if (tokenString && tokenString.indexOf('=') > -1) { this.onSubmit(token);