Browse Source

Merge branch 'xiaowang-feature' of http://120.46.222.128:10021/elink-star/epmet-wx-pa-chengyang into xiaowang-feature

xiaowang-feature
是小王呀\24601 9 months ago
parent
commit
5a45637e29
  1. 2
      README.md
  2. 17
      src/router/index.js

2
README.md

@ -6,7 +6,7 @@
然后跑起来之后你本地的域名就会变成epmet-cloud.elinkservice.cn 然后跑起来之后你本地的域名就会变成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 版本要求 ### Node 版本要求

17
src/router/index.js

@ -5,8 +5,8 @@ import { constantRouterMap } from './router.config.js'
import { checkWxmpRegister, login } from '@/api/user' import { checkWxmpRegister, login } from '@/api/user'
import { title } from '@/config' import { title } from '@/config'
const whiteList = ['/login','/goldenIdea','/mySuggestions'] const whiteList = ['/login','/register', '/errorPage','/selectAgency','/houseQR','/event']
const specialList = ['/topicList','/topicListDetail','/goldenIdeaDetail','/SpecialsolicitationFill','/specialTopicList','/register', '/errorPage','/selectAgency','/houseQR','/event','/peoSuggestion','/peoSuggestionexplain','/solicitationDaily'] const specialList = ['/topicList','/topicListDetail','/goldenIdeaDetail','/SpecialsolicitationFill','/specialTopicList','/peoSuggestion','/peoSuggestionexplain','/solicitationDaily','/goldenIdea','/mySuggestions']
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) { Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, 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) localStorage.setItem('appId', urlParams.appId)
} else { } else {
store.commit('SET_APP_ID', 'wxce2db0866b0698f8') 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) { if (to.params.type) {
document.title = to.params.type === 'edit' ? '编辑' : '注册' document.title = to.params.type === 'edit' ? '编辑' : '注册'
} else { } else {
@ -143,14 +135,13 @@ router.beforeEach((to, from, next) => {
} }
}) })
} else { } else {
if (whiteList.includes(to.path)) { if (whiteList.includes(to.path) || specialList.includes(to.path) ) {
next() next()
} else { } else {
next({ path: '/login', query: { redirect: to.path, params: JSON.stringify(to.query) } }) next({ path: '/login', query: { redirect: to.path, params: JSON.stringify(to.query) } })
} }
} }
} }
// }
}) })
function getQueryParams() { function getQueryParams() {

Loading…
Cancel
Save