diff --git a/main.js b/main.js index 23eb888..66258c1 100644 --- a/main.js +++ b/main.js @@ -38,14 +38,6 @@ Vue.prototype.$validator = function (rule) { return new schema(rule); }; -// const CACHE_KEY = "clear_0.0.1"; - -// if (!cookie.has(CACHE_KEY)) { -// cookie.clearAll(); -// cookie.set(CACHE_KEY, 1); -// } - - Vue.config.productionTip = false App.mpType = 'app' Vue.prototype.$store = store @@ -128,7 +120,7 @@ import { isWeixin } from '@/utils' const CACHE_KEY = "clear_0.0.1"; if (!cookie.has(CACHE_KEY)) { - cookie.clearAll(); + cookie.clearAll() cookie.set(CACHE_KEY, 1); } @@ -146,7 +138,7 @@ if (urlSpread !== undefined) { // #endif - + async function init() { // #ifdef H5 diff --git a/pages/Loading/index.vue b/pages/Loading/index.vue index 4c9d143..578a2eb 100644 --- a/pages/Loading/index.vue +++ b/pages/Loading/index.vue @@ -48,36 +48,20 @@ } else if (spread === 0 || typeof spread !== "number") { cookie.set("spread", urlSpread || 0); } - if (this.$store.getters.token) { - this.toLaunch(); - return; - } } - - // cookie.get("spread"); - // if (this.$deviceType == "weixin") { - // let path = parseQuery().path - // console.log(this) - // if (path) { - // this.$yrouter.push({ - // path - // }); - // } else { - // this.$yrouter.switchTab({ - // path: "/pages/home/index" - // }); - // } - - // return + // if (this.$deviceType == "app" || this.$deviceType == "weixinh5") { + // this.$yrouter.switchTab({ + // path: "/pages/home/index" + // }); + // return; // } - // this.toLaunch(); - if (this.$deviceType == "app" || this.$deviceType == "weixinh5") { - // this.toLaunch(); - this.$yrouter.switchTab({ - path: "/pages/home/index" - }); + if (this.$store.getters.token) { + // 如果token存在,直接进行进页面 + console.log('登录状态存在,直接进页面') + this.toLaunch(); return; } + console.log('进行登录操作') login().finally(() => { this.$yrouter.switchTab({ path: "/pages/home/index" @@ -89,9 +73,18 @@ toLaunch() { console.log("loading home"); this.changeAuthorization(false); - this.$yrouter.switchTab({ - path: "/pages/home/index" - }); + let redirect = cookie.get('redirect') + if (redirect) { + redirect = redirect.split('/pages')[1] + this.$yrouter.replace({ + path: '/pages' + redirect, + }); + cookie.remove('redirect'); + } else { + this.$yrouter.replace({ + path: '/pages/home/index', + }); + } } } }; diff --git a/pages/activity/DargainDetails/index.vue b/pages/activity/DargainDetails/index.vue index d931b90..1e40300 100644 --- a/pages/activity/DargainDetails/index.vue +++ b/pages/activity/DargainDetails/index.vue @@ -1,10 +1,11 @@