Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-03-26 16:53:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3f8eefb4b74c5b90ba5cf3b4178a90359481408f
3f8eefb4
1 parent
9f0ee684
refactor(router): 简化未授权地址的生成逻辑
移除冗余的路径拼接,直接使用location.href生成未授权地址,使代码更简洁易读
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
src/router/guards.js
src/router/guards.js
View file @
3f8eefb
/*
* @Date: 2025-03-20 20:36:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-26 1
3:50:07
* @LastEditTime: 2025-03-26 1
6:52:03
* @FilePath: /mlaj/src/router/guards.js
* @Description: 路由守卫逻辑
*/
...
...
@@ -31,7 +31,7 @@ export const checkWxAuth = async () => {
const
{
code
,
data
}
=
await
getAuthInfoAPI
();
if
(
code
&&
!
data
.
openid_has
)
{
// 直接在这里处理授权跳转
let
raw_url
=
encodeURIComponent
(
location
.
origin
+
location
.
pathname
+
location
.
href
);
// 未授权的地址
let
raw_url
=
encodeURIComponent
(
location
.
href
);
// 未授权的地址
const
short_url
=
`/srv/?f=behalo&a=openid&res=
${
raw_url
}
`
;
location
.
href
=
short_url
;
...
...
Please
register
or
login
to post a comment