🐛 fix头像、文章资源上传失败

This commit is contained in:
不做码农
2023-07-05 20:28:45 +08:00
parent 032d88c996
commit d95fdf0021
3 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -29,8 +29,9 @@ service.interceptors.request.use(
config.headers['userName'] = useUserStore().userName
}
const method = config?.method || 'get'
const header = config?.headers['Content-Type'] ?? ''
if (method.toLowerCase() === 'post' || method.toLowerCase() === 'put') {
if ((method.toLowerCase() === 'post' || method.toLowerCase() === 'put') && header != 'multipart/form-data') {
config.data = delEmptyQueryNodes(config.data)
}
return config