Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
xyxBooking-weapp
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
2026-01-18 00:05:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a9474913754b36d13883514e4ded8e710e7103fb
a9474913
1 parent
a99b40c5
docs(authRedirect): 改进代码注释格式并添加类型标注
将单行注释改为多行文档注释并添加JSDoc类型标注,提高代码可读性和IDE支持
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
src/utils/authRedirect.js
src/utils/authRedirect.js
View file @
a947491
...
...
@@ -3,9 +3,16 @@ import { routerStore } from '@/stores/router'
import
{
buildApiUrl
}
from
'./tools'
// 改进:添加全局状态变量注释
// 上一次跳转到授权页的时间戳,用于防抖(避免短时间内重复跳转)
/**
* 上一次跳转到授权页的时间戳,用于防抖(避免短时间内重复跳转)
* @type {number}
*/
let
last_navigate_auth_at
=
0
// 是否正在跳转到授权页,用于防重复(避免并发跳转)
/**
* 是否正在跳转到授权页,用于防重复(避免并发跳转)
* @type {boolean}
*/
let
navigating_to_auth
=
false
/**
...
...
@@ -228,8 +235,17 @@ export const silentAuth = async (on_success, on_error, options) => {
}
}
const
NAVIGATE_AUTH_COOLDOWN_MS
=
1200
// 防重复跳转冷却时间
const
NAVIGATING_RESET_DELAY_MS
=
300
// 导航状态重置延迟
/**
* 防重复跳转冷却时间 (毫秒)
* @type {number}
*/
const
NAVIGATE_AUTH_COOLDOWN_MS
=
1200
/**
* 导航状态重置延迟时间 (毫秒)
* @type {number}
*/
const
NAVIGATING_RESET_DELAY_MS
=
300
/**
* 跳转到授权页(降级方案)
...
...
Please
register
or
login
to post a comment