把前台需要的登录信息 拿过去(比如token,refreshToken 看前台需要啥,就传啥)
?
//预览
goSee(row) {
console.log(this.userInfo)
let userInfos = this.userInfo.account;
let account = {
account: userInfos.user.account,
avatarId: userInfos.user.id,
expiration: userInfos.expireTime,
name: userInfos.user.name,
refreshToken: userInfos.refreshToken,
token: userInfos.token,
tokenType: "token",
userId: userInfos.user.id,
}
// return
let href = 'http://devops.smartcloud.com:10082/ztf-zixun/new-train-student-frontend/test/#/allCourseDetailLogin?courseId='
+ row.courseId + '&userInfo=' + JSON.stringify(account);
window.open(href)
},
?
在这个项目里,前台就是需要登录信息。并且登录信息是存储在localStorage中userInfo里面的
computed: {
courseVideoId() {
return store.state.courseVideoId;
},
userInfo() {
let userInfo = (localStorage.getItem("userInfo") ? JSON.parse(localStorage.getItem("userInfo")) : '') || (this.$route.query && (this.$route.query.userInfo ? JSON.parse(this.$route.query.userInfo) : ''))
console.log(userInfo, 'userInfo')
if (userInfo) {
localStorage.setItem('userInfo', JSON.stringify(userInfo));
} else {
userInfo = ''
}
return userInfo
}
},