fix: 1. 全局axios添加formData文件上传的检测,删除Content-Type让axios自动检测。
2. 完善入口模块管理的接口的对接。 3. 完善角色权限管理的接口对接和测试。 4. 完善主页的入口模块的图标的显示和图片的显示。
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user