af-mobile-client-vue3 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/router/guards.ts
CHANGED
|
@@ -35,7 +35,7 @@ function loginGuard(to: RouteLocationNormalized, from: RouteLocationNormalized,
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// 已登录用户的处理
|
|
38
|
-
if (token) {
|
|
38
|
+
if (token && !to.query.appData) {
|
|
39
39
|
// 如果已登录且访问登录页,重定向到首页
|
|
40
40
|
if (to.path === '/login') {
|
|
41
41
|
const defaultRoute = userStore.getDefaultRoute()
|
|
@@ -47,7 +47,7 @@ function loginGuard(to: RouteLocationNormalized, from: RouteLocationNormalized,
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// 未登录用户的处理
|
|
50
|
-
if (!token) {
|
|
50
|
+
if (!token || to.query.appData) {
|
|
51
51
|
// 使用统一的检测函数判断用户类型
|
|
52
52
|
const externalResult = isExternalUser(to)
|
|
53
53
|
|
|
@@ -97,7 +97,7 @@ async function handleExternalLogin(loginParams: any) {
|
|
|
97
97
|
await router.replace({
|
|
98
98
|
path: targetPath,
|
|
99
99
|
query: (() => {
|
|
100
|
-
const query = {...route.query}
|
|
100
|
+
const query = { ...route.query }
|
|
101
101
|
// 删除不需要的参数
|
|
102
102
|
delete query.redirect
|
|
103
103
|
delete query.state
|
|
@@ -109,7 +109,7 @@ async function handleExternalLogin(loginParams: any) {
|
|
|
109
109
|
delete query.appData
|
|
110
110
|
// 可以继续删除其他不需要的参数
|
|
111
111
|
return query
|
|
112
|
-
})()
|
|
112
|
+
})(),
|
|
113
113
|
})
|
|
114
114
|
}
|
|
115
115
|
|