From 49b299e1aa24d39cd5c714f047deb1cf7976acd8 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Fri, 29 Nov 2024 10:17:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=BC=80=E5=85=8D=E7=99=BB=E4=B8=BA?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/router/index.js | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4e111ca..ab8e193 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 然后跑起来之后你本地的域名就会变成epmet-cloud.elinkservice.cn ↓↓↓↓ 在你小程序的公众号开发中输入以下网址就能够访问了 -http://epmet-test.elinkservice.cn:80/#/?appId=wxce2db0866b0698f8&redirect=epmet-test.elinkservice.cn&houseId=1640692803448688642 +http://epmet-test.elinkservice.cn:80/#/peoSuggestion?appId=wxce2db0866b0698f8&redirect=epmet-test.elinkservice.cn&houseId=1640692803448688642 ### Node 版本要求 diff --git a/src/router/index.js b/src/router/index.js index 4f5696c..5876c8b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,8 +5,8 @@ import { constantRouterMap } from './router.config.js' import { checkWxmpRegister, login } from '@/api/user' import { title } from '@/config' -const whiteList = ['/login','/goldenIdea','/mySuggestions'] -const specialList = ['/topicList','/topicListDetail','/goldenIdeaDetail','/SpecialsolicitationFill','/specialTopicList','/register', '/errorPage','/selectAgency','/houseQR','/event','/peoSuggestion','/peoSuggestionexplain','/solicitationDaily'] +const whiteList = ['/login','/register', '/errorPage','/selectAgency','/houseQR','/event'] +const specialList = ['/topicList','/topicListDetail','/goldenIdeaDetail','/SpecialsolicitationFill','/specialTopicList','/peoSuggestion','/peoSuggestionexplain','/solicitationDaily','/goldenIdea','/mySuggestions'] const originalPush = Router.prototype.push Router.prototype.push = function push(location, onResolve, onReject) { if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) @@ -67,15 +67,7 @@ router.beforeEach((to, from, next) => { localStorage.setItem('appId', urlParams.appId) } else { store.commit('SET_APP_ID', 'wxce2db0866b0698f8') - // store.commit('SET_APP_ID', localStorage.getItem('appId')) } - // if (!localStorage.getItem('appId') && to.path !== '/errorPage'&& to.path != '/houseQR') { - // if(to.path === '/errorPage'){ - // next('/errorPage') - // }else{ - // next('/') - // } - // } else { if (to.params.type) { document.title = to.params.type === 'edit' ? '编辑' : '注册' } else { @@ -143,14 +135,13 @@ router.beforeEach((to, from, next) => { } }) } else { - if (whiteList.includes(to.path)) { + if (whiteList.includes(to.path) || specialList.includes(to.path) ) { next() } else { next({ path: '/login', query: { redirect: to.path, params: JSON.stringify(to.query) } }) } } } - // } }) function getQueryParams() {