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-12-25 09:57:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
610911611c9825069b3d13486d545c8e98ed88ff
61091161
1 parent
82e4c209
fix(axios): 为desk_calendar接口强制指定用户ID和Token
特殊处理desk_calendar接口请求,使用固定的用户ID和Token以确保接口正常访问
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
src/utils/axios.js
src/utils/axios.js
View file @
6109116
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-28 10:17:40
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-
04 14:06:16
* @LastEditTime: 2025-12-
25 09:56:58
* @FilePath: /mlaj/src/utils/axios.js
* @Description:
*/
...
...
@@ -52,6 +52,13 @@ axios.interceptors.request.use(
config
.
headers
[
'User-Id'
]
=
user_info
.
user_id
;
config
.
headers
[
'User-Token'
]
=
user_info
.
HTTP_USER_TOKEN
;
}
// NOTE: 特殊处理 a=desk_calendar 接口, 强制使用指定的 User-Id 和 User-Token
if
((
config
.
params
&&
config
.
params
.
a
===
'desk_calendar'
)
||
(
config
.
url
&&
config
.
url
.
includes
(
'a=desk_calendar'
)))
{
config
.
headers
[
'User-Id'
]
=
'1033954'
;
config
.
headers
[
'User-Token'
]
=
'WN2BD9XQ7CRSVQ92FMB62V9C9OHHRBL38L2NS4GJ#1033954#50'
;
}
// const url_params = parseQueryString(location.href);
// GET请求默认打上时间戳,避免从缓存中拿数据。
const
timestamp
=
config
.
method
===
'get'
?
(
new
Date
()).
valueOf
()
:
''
;
...
...
Please
register
or
login
to post a comment