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