mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 11:56:46 +08:00
导出详细学习记录 - loading 更改 5
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
import axios from 'axios'
|
||||
import {getCookieForName} from "@/api/method";
|
||||
import { ref } from 'vue';
|
||||
|
||||
const mimeMap = {
|
||||
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
zip: 'application/zip'
|
||||
}
|
||||
export function downLoadXlsx(str, filename) {
|
||||
await axios({
|
||||
method: 'get',
|
||||
url: str,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
|
||||
}).then(res => {
|
||||
export const downLoadXlsx = async (str, filename,exportLoading) => {
|
||||
const res = await axios({
|
||||
method: 'get',
|
||||
url: str,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
|
||||
});
|
||||
resolveBlob(res, mimeMap.xlsx,filename)
|
||||
})
|
||||
exportLoading.value = false;
|
||||
return { exportLoading };
|
||||
}
|
||||
const baseUrl = process.env.VUE_APP_ACT_API
|
||||
export function downLoadZip(str, filename) {
|
||||
|
||||
Reference in New Issue
Block a user