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