♻️ refactor: 重写token截取规则
This commit is contained in:
parent
7a0fa5b76d
commit
570427fb2f
|
@ -17,7 +17,10 @@ export default class App extends Component {
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const tokenString = this.props.location.search;
|
const tokenString = this.props.location.search;
|
||||||
const token = tokenString.substring(tokenString.indexOf('=') + 1);
|
const token = tokenString.substring(
|
||||||
|
tokenString.indexOf('=') + 1,
|
||||||
|
tokenString.indexOf('&')
|
||||||
|
);
|
||||||
/* 判断是否有token */
|
/* 判断是否有token */
|
||||||
if (tokenString && tokenString.indexOf('=') > -1) {
|
if (tokenString && tokenString.indexOf('=') > -1) {
|
||||||
this.onSubmit(token);
|
this.onSubmit(token);
|
||||||
|
|
Loading…
Reference in New Issue