✨ feat: 统一登录跳转后解析头像
This commit is contained in:
parent
0de24d258d
commit
33b6028716
|
@ -18,10 +18,14 @@ 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('&')
|
||||
);
|
||||
const head = tokenString.substring(tokenString.indexOf('&') + 6);
|
||||
/* 判断是否有token */
|
||||
if (tokenString && tokenString.indexOf('=') > -1) {
|
||||
this.onSubmit(token);
|
||||
this.onSubmit(token, head);
|
||||
return;
|
||||
}
|
||||
/* 调整统一登录平台 */
|
||||
|
@ -48,8 +52,8 @@ export default class App extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
onSubmit(authorization) {
|
||||
postLoginCode({ authorization })
|
||||
onSubmit(authorization, head) {
|
||||
postLoginCode({ authorization, head })
|
||||
.then((res) => {
|
||||
handelResponse(
|
||||
res,
|
||||
|
|
Loading…
Reference in New Issue