diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index b541f45..a767105 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -54,5 +54,5 @@ export const deletePostApi = (id: number) => { // 导出岗位 export const exportPostApi = (params: PostExportReqVO) => { - return defHttp.download({ url: '/system/post/export', params }) + return defHttp.download({ url: '/system/post/export', params }, '导出岗位.xls') } diff --git a/src/utils/http/axios/Axios.ts b/src/utils/http/axios/Axios.ts index a4a416d..20d0170 100644 --- a/src/utils/http/axios/Axios.ts +++ b/src/utils/http/axios/Axios.ts @@ -236,7 +236,7 @@ export class VAxios { return this.request({ ...config, method: 'DELETE' }, options) } - download(config: AxiosRequestConfig, title: string, options?: RequestOptions): Promise { + download(config: AxiosRequestConfig, title?: string, options?: RequestOptions): Promise { let conf: CreateAxiosOptions = cloneDeep({ ...config, method: 'GET', @@ -264,7 +264,7 @@ export class VAxios { resolve(res as unknown as Promise) // download file if (typeof res != undefined) { - downloadByData(res?.data as unknown as BlobPart, title) + downloadByData(res?.data as unknown as BlobPart, title || 'export') } }) .catch((e: Error | AxiosError) => { diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index cc75456..1b1156c 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -3,6 +3,7 @@