Browse Source

访问ui页面绕过登陆

login-ui-0106
zq 2 weeks ago
parent
commit
930b3d20dc
  1. 11
      src/utils/login.js

11
src/utils/login.js

@ -11,7 +11,15 @@ function axiosWithTimeout(promise, ms) {
}
export async function autoLoginByToken(timeout = 10000) {
// 检查当前路径是否为 /ui 页面
const currentPath = window.location.pathname
const isUIPage = currentPath.startsWith('/ui')
// 如果是 /ui 页面,跳过登录校验
if (isUIPage) {
console.log('访问 UI 页面,跳过登录校验')
return true
}
const urlParams = new URLSearchParams(window.location.search)
const token = urlParams.get('token')
@ -53,7 +61,6 @@ export async function autoLoginByToken(timeout = 10000) {
//非代理商 直接跳至加盟页 访问加盟页的话 不再重复跳转
const agent = localStorage.getItem('aid')
const currentPath = window.location.pathname
if(agent === null && currentPath !== '/franchise'){
const aid = urlParams.get('aid')
if(aid){

Loading…
Cancel
Save