|
@@ -121,18 +121,18 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
console.log('学生校内账号登录后的学生信息 > ', studentInfo)
|
|
|
+ let auth = jwtDecode(studentInfo.auth_token)
|
|
|
// 儲存大雲Token
|
|
|
localStorage.setItem("access_token", studentInfo.token.access_token)
|
|
|
localStorage.setItem("stu_auth_token", studentInfo.auth_token)
|
|
|
localStorage.setItem("stu_id_token", studentInfo.token.id_token)
|
|
|
// 更新vuex学生基础信息
|
|
|
- $store.dispatch('user/setSchoolCode', params.school_code)
|
|
|
+ $store.dispatch('user/setSchoolCode', auth.azp)
|
|
|
$store.dispatch('user/setStudentProfile', studentInfo)
|
|
|
- localStorage.setItem("stu_login_sch_code", params.school_code)
|
|
|
// 注入身份权限
|
|
|
- let auth = jwtDecode(studentInfo.auth_token)
|
|
|
+ localStorage.setItem("stu_login_sch_code", auth.azp)
|
|
|
User.login({
|
|
|
- id: params.id,
|
|
|
+ id: params.id || auth.sub,
|
|
|
roles: ['student'],
|
|
|
permissions: auth.permissions == null ? [] : auth.permissions,
|
|
|
picture: ''
|