fetch(add): 新增
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Failing after 6s

This commit is contained in:
sexygoat
2026-01-27 09:18:45 +08:00
parent 0eed8244e5
commit 5c6312c407
33 changed files with 4897 additions and 374 deletions

View File

@@ -170,16 +170,16 @@ export class BaseService {
if (params) {
Object.keys(params).forEach((key) => {
formData.append(key, params[key])
if (params[key] !== undefined && params[key] !== null && params[key] !== '') {
formData.append(key, String(params[key]))
}
})
}
// 不要手动设置 Content-Type,让浏览器自动设置(包含正确的 boundary)
return request.post<BaseResponse<T>>({
url,
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
data: formData
})
}