mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-30 03:01:53 +08:00
修复登录的 redirect 地址,存在参数时,登录成功回跳的时候地址不正确的问题
This commit is contained in:
parent
ab40254bc1
commit
585d2a523b
@ -48,7 +48,8 @@ router.beforeEach((to, from, next) => {
|
|||||||
// 在免登录白名单,直接进入
|
// 在免登录白名单,直接进入
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
const redirect = encodeURIComponent(to.fullPath) // 编码 URI,保证参数跳转回去后,可以继续带上
|
||||||
|
next(`/login?redirect=${redirect}`) // 否则全部重定向到登录页
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ export default {
|
|||||||
// 验证码开关
|
// 验证码开关
|
||||||
this.captchaEnable = getCaptchaEnable();
|
this.captchaEnable = getCaptchaEnable();
|
||||||
// 重定向地址
|
// 重定向地址
|
||||||
this.redirect = this.$route.query.redirect;
|
this.redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : undefined;
|
||||||
this.getCookie();
|
this.getCookie();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -117,7 +117,7 @@ export default {
|
|||||||
// 验证码开关
|
// 验证码开关
|
||||||
this.captchaEnable = getCaptchaEnable();
|
this.captchaEnable = getCaptchaEnable();
|
||||||
// 重定向地址
|
// 重定向地址
|
||||||
this.redirect = this.$route.query.redirect;
|
this.redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : undefined;
|
||||||
// 社交登录相关
|
// 社交登录相关
|
||||||
this.type = this.$route.query.type;
|
this.type = this.$route.query.type;
|
||||||
this.code = this.$route.query.code;
|
this.code = this.$route.query.code;
|
||||||
|
Loading…
Reference in New Issue
Block a user