支持导出详细教学班名单和 Moodle CSV

This commit is contained in:
biss committed 2026-11-22 20:37:47 +08:00
1 parent 821bfb083a
commit 5d5781e707
6 files changed
+122 -6

No files matched your search

+5
View File
@@ -35,6 +35,11 @@ export async function downloadApiFile(
const response = await http.get(path, {
...config,
responseType: 'blob',
}).catch(async (error) => {
if (error.response?.data instanceof Blob && error.response.data.type.includes('json')) {
try { error.response.data = JSON.parse(await error.response.data.text()) } catch { /* Keep the original response. */ }
}
throw error
})
const url = URL.createObjectURL(response.data)
const anchor = document.createElement('a')