fix(axios): 为desk_calendar接口强制指定用户ID和Token
特殊处理desk_calendar接口请求,使用固定的用户ID和Token以确保接口正常访问
Showing
1 changed file
with
8 additions
and
1 deletions
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * @Author: hookehuyr hookehuyr@gmail.com | 2 | * @Author: hookehuyr hookehuyr@gmail.com |
| 3 | * @Date: 2022-05-28 10:17:40 | 3 | * @Date: 2022-05-28 10:17:40 |
| 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 5 | - * @LastEditTime: 2025-12-04 14:06:16 | 5 | + * @LastEditTime: 2025-12-25 09:56:58 |
| 6 | * @FilePath: /mlaj/src/utils/axios.js | 6 | * @FilePath: /mlaj/src/utils/axios.js |
| 7 | * @Description: | 7 | * @Description: |
| 8 | */ | 8 | */ |
| ... | @@ -52,6 +52,13 @@ axios.interceptors.request.use( | ... | @@ -52,6 +52,13 @@ axios.interceptors.request.use( |
| 52 | config.headers['User-Id'] = user_info.user_id; | 52 | config.headers['User-Id'] = user_info.user_id; |
| 53 | config.headers['User-Token'] = user_info.HTTP_USER_TOKEN; | 53 | config.headers['User-Token'] = user_info.HTTP_USER_TOKEN; |
| 54 | } | 54 | } |
| 55 | + | ||
| 56 | + // NOTE: 特殊处理 a=desk_calendar 接口, 强制使用指定的 User-Id 和 User-Token | ||
| 57 | + if ((config.params && config.params.a === 'desk_calendar') || (config.url && config.url.includes('a=desk_calendar'))) { | ||
| 58 | + config.headers['User-Id'] = '1033954'; | ||
| 59 | + config.headers['User-Token'] = 'WN2BD9XQ7CRSVQ92FMB62V9C9OHHRBL38L2NS4GJ#1033954#50'; | ||
| 60 | + } | ||
| 61 | + | ||
| 55 | // const url_params = parseQueryString(location.href); | 62 | // const url_params = parseQueryString(location.href); |
| 56 | // GET请求默认打上时间戳,避免从缓存中拿数据。 | 63 | // GET请求默认打上时间戳,避免从缓存中拿数据。 |
| 57 | const timestamp = config.method === 'get' ? (new Date()).valueOf() : ''; | 64 | const timestamp = config.method === 'get' ? (new Date()).valueOf() : ''; | ... | ... |
-
Please register or login to post a comment