update @home页 key优化
This commit is contained in:
parent
a996139f1e
commit
1416849fe9
|
@ -74,6 +74,9 @@ router.beforeEach(async (to, from, next) => {
|
|||
localStorage.setItem("key", strP || "");
|
||||
next({
|
||||
path: "/home",
|
||||
query: {
|
||||
key: strP || "",
|
||||
}
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
|
|
|
@ -12,10 +12,10 @@ export default {
|
|||
name: 'home',
|
||||
data() {
|
||||
return {
|
||||
key: localStorage.getItem('key'),
|
||||
key: this.$route.query.key || localStorage.getItem("openid") || '',
|
||||
loginBack: this.$route.query.loginBack,
|
||||
// jumpPath: this.$route.query.jumpPath,
|
||||
openid: this.$route.query.openid || localStorage.getItem("openid"), // 微信授权id
|
||||
openid: this.$route.query.openid || localStorage.getItem("openid") || '', // 微信授权id
|
||||
isAutoEmpower: true,
|
||||
loadingText: '加载中',
|
||||
dialogType: '',
|
||||
|
@ -31,6 +31,8 @@ export default {
|
|||
if (!this.loginBack) {
|
||||
sessionStorage.clear();
|
||||
localStorage.clear();
|
||||
this.key && localStorage.setItem("token", this.key);
|
||||
this.openid && localStorage.setItem("openid", this.openid);
|
||||
this.preLogic();
|
||||
} else {
|
||||
this.dialogText = 'Token已过期';
|
||||
|
@ -42,7 +44,6 @@ export default {
|
|||
if (res && res.code === 200) {
|
||||
if (res.data.Token) {
|
||||
localStorage.setItem("token", res.data.Token || '');
|
||||
localStorage.setItem("key", this.key || '');
|
||||
// sessionStorage.setItem("jumpPath", this.jumpPath || ''); // 复制链接-直接跳转详情页(暂时不用)
|
||||
|
||||
// 微信环境 自动授权
|
||||
|
|
Loading…
Reference in New Issue