课表优化
This commit is contained in:
1 parent
e8482b26f2
commit
cd4ffa1d85
7 files changed
+569
-34
No files matched your search
@@ -28,6 +28,22 @@ export async function downloadApiFile(
|
||||
URL.revokeObjectURL(url)
|
||||
}
|
||||
|
||||
export async function downloadApiPostFile(
|
||||
path: string,
|
||||
payload: unknown,
|
||||
fallbackName: string,
|
||||
) {
|
||||
const response = await http.post(path, payload, { responseType: 'blob' })
|
||||
const url = URL.createObjectURL(response.data)
|
||||
const anchor = document.createElement('a')
|
||||
anchor.href = url
|
||||
anchor.download = responseFileName(response.headers['content-disposition'], fallbackName)
|
||||
document.body.appendChild(anchor)
|
||||
anchor.click()
|
||||
anchor.remove()
|
||||
URL.revokeObjectURL(url)
|
||||
}
|
||||
|
||||
export async function importExcel(path: string, file: File) {
|
||||
const form = new FormData()
|
||||
form.append('file', file)
|
||||
|
||||
Reference in new issue
Block a user