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