feat: 统一登录跳转后解析头像

This commit is contained in:
wangsongsole 2023-04-14 10:28:17 +08:00
parent 0de24d258d
commit 33b6028716
1 changed files with 8 additions and 4 deletions

View File

@ -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,