feat:导出失败的问题

This commit is contained in:
dzc committed 2025-08-28 19:31:14 +08:00
1 parent b765e84642
commit 925f25e9a6
2 files changed
+6 -3

No files matched your search

+4 -1
View File
@@ -331,6 +331,7 @@ export function handleBlobFile(response: any, fileName: string) {
blob = new Blob(safeData, { type: "application/octet-stream" })
}
} catch (error) {
console.error("导出错误", error)
useMessage().error("文件数据格式错误")
return
}
@@ -353,8 +354,10 @@ export function handleBlobFile(response: any, fileName: string) {
"image/jpeg",
"image/png",
// "application/zip" // 添加 ZIP 文件类型支持
"application/octet-stream"
"application/octet-stream",
"text/xml",
]
if (!allowedTypes.includes(blob.type) && blob.type !== "") {
useMessage().error("不支持的文件类型")
return
+2 -2
View File
@@ -246,12 +246,12 @@ const taskSubmitEvent = () => {
// 导出excel
const exportExcel = () => {
const _data = { ...state.queryForm }
if (_data.role) {
if (_data.role && !Array.isArray(_data.role)) {
_data.role = [_data.role]
} else {
_data.role = []
}
postDownBlobFile("/admin/user/export", Object.assign(_data, { ids: selectObjs }), "用户管理.xlsx")
postDownBlobFile("/admin/user/export", Object.assign(_data, { ids: selectObjs.value }), "用户管理.xlsx")
}
// 是否可以多选