diff --git a/src/router/index.ts b/src/router/index.ts index f94a39f..4da9566 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -6,19 +6,6 @@ import { // 公共路由 const routePublic = [ - // { - // path: "/", - // redirect: { name: 'home', params: { key: 'default_key' } } - // }, - // { - // path: "/:key", - // redirect: { name: 'home' } - // }, - // { - // path: "/home/:key", - // name: "home", - // component: () => import("../views/home.vue"), - // }, { path: "/", redirect: "/home", @@ -78,9 +65,9 @@ const router = createRouter({ router.beforeEach(async (to, from, next) => { const rouList = routes.filter( - (item) => item.path != "/" && item.path === to.fullPath + (item) => item.path !== "/" && item.path === to.path ); - if (from.fullPath === "/" && rouList.length === 0) { + if (from.path === "/" && rouList.length === 0) { const url = window.location.href; const str = url.split("/"); const strP = str[str.length - 1]; diff --git a/src/views/home.vue b/src/views/home.vue index 391178d..78b1e2b 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -12,7 +12,7 @@ export default { name: 'home', data() { return { - key: this.$route.params.key || this.$route.query.key || localStorage.getItem('key'), + key: localStorage.getItem('key'), loginBack: this.$route.query.loginBack, // jumpPath: this.$route.query.jumpPath, openid: this.$route.query.openid || localStorage.getItem("openid"), // 微信授权id @@ -23,7 +23,7 @@ export default { } }, created() { - if (!this.key || this.key === 'default_key') { + if (!this.key) { this.loginBack = ''; this.dialogType = 'error'; return this.dialogText = 'key不存在'; diff --git a/src/views/pages/comProduct/index.vue b/src/views/pages/comProduct/index.vue index b671ff2..a19f4e3 100644 --- a/src/views/pages/comProduct/index.vue +++ b/src/views/pages/comProduct/index.vue @@ -253,6 +253,7 @@ export default { async getData(type?: string) { this.overlayLoad = false; this.loadingStatus = true; + if (!this.groupId) return showToast('组合商品ID不能为空'); this.pageData = new Map([['31', []], ['32', []], ['33', []], ['2', []], ['1', []]]); const res = await QUERY({ key: this.key, diff --git a/src/views/templates/cmsList/index.vue b/src/views/templates/cmsList/index.vue index 88a31df..52133d9 100644 --- a/src/views/templates/cmsList/index.vue +++ b/src/views/templates/cmsList/index.vue @@ -112,7 +112,7 @@ export default { // modules: [ Pagination, Autoplay ], initialSlide: 1, key: this.$route.query.key || localStorage.getItem('key'), - jumpPath: sessionStorage.getItem('jumpPath'), + // jumpPath: sessionStorage.getItem('jumpPath'), loadingStatus: false, pageData: null, cssData: {