Commit 2e4c266b authored by FE-安焕焕's avatar FE-安焕焕 👣

修改路由跳转问题

parent 3847ca83
// todo: 测试环境部署的时候对xyqb.com进行替换,先改成这样进行测试,上线改回来
// const sapi = '//recruit.xyqb.com'
const sapi = '//api.stantoo.com'
export {
......
......@@ -3,10 +3,14 @@ export default{
init: function (router) {
router.beforeEach((to, form, next) => {
let token = localstorage.get('token')
if (!token&&to.name!=='login'&&to.name!=='text') {
if (to.name =='login' || to.name =='text' || to.name =='sweepCode'){
next()
return
}
if(!token){
window.location.href = `${window.location.origin}/login`
return
}
}
next()
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment