Browse Source

分开免登为两个

xiaowang-feature
mk 9 months ago
parent
commit
49b299e1aa
  1. 2
      README.md
  2. 15
      src/router/index.js

2
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 版本要求

15
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() {

Loading…
Cancel
Save