fix: 1. 全局axios添加formData文件上传的检测,删除Content-Type让axios自动检测。

2. 完善入口模块管理的接口的对接。
3. 完善角色权限管理的接口对接和测试。
4. 完善主页的入口模块的图标的显示和图片的显示。
This commit is contained in:
2025-11-29 19:37:29 +08:00
parent 5600de413f
commit fb67f138dc
11 changed files with 290 additions and 164 deletions
+6
View File
@@ -80,6 +80,12 @@ function isInErrorTolerantWhitelist(url?: string): boolean {
*/
axiosInstance.interceptors.request.use(
(config) => {
// ⭐ 检测 FormData,删除默认的 Content-Type,让 axios 自动处理
if (config.data instanceof FormData) {
console.log('📦 [Request Interceptor] 检测到FormData,删除Content-Type让axios自动处理');
delete config.headers['Content-Type'];
}
// 检查是否在白名单中
if (isInAuthWhitelist(config.url)) {
console.log('🔓 [Request Interceptor] URL在白名单中,跳过Authorization:', config.url);