From 4762132362d53051aa5e2f383b7230cf5fddbbfb Mon Sep 17 00:00:00 2001 From: xingyuv Date: Mon, 20 Mar 2023 17:50:37 +0800 Subject: [PATCH] feat: download add title --- src/api/infra/apiAccessLog/index.ts | 2 +- src/api/infra/apiErrorLog/index.ts | 13 ++++++++----- src/api/infra/codegen/index.ts | 2 +- src/api/infra/config/index.ts | 2 +- src/api/infra/dbDoc/index.ts | 6 +++--- src/api/infra/job/index.ts | 2 +- src/api/infra/jobLog/index.ts | 11 +++++++---- src/api/pay/app/index.ts | 2 +- src/api/pay/channel/index.ts | 2 +- src/api/pay/merchant/index.ts | 2 +- src/api/pay/order/index.ts | 2 +- src/api/pay/refund/index.ts | 2 +- src/api/system/errorCode/index.ts | 2 +- src/api/system/loginLog/index.ts | 2 +- src/api/system/operatelog/index.ts | 2 +- src/api/system/sensitiveWord/index.ts | 2 +- src/api/system/sms/smsLog/index.ts | 2 +- src/api/system/sms/smsTemplate/index.ts | 2 +- src/api/system/tenant/index.ts | 2 +- src/api/system/user/index.ts | 4 ++-- 20 files changed, 36 insertions(+), 30 deletions(-) diff --git a/src/api/infra/apiAccessLog/index.ts b/src/api/infra/apiAccessLog/index.ts index 15aa4ee1..722ab804 100644 --- a/src/api/infra/apiAccessLog/index.ts +++ b/src/api/infra/apiAccessLog/index.ts @@ -46,5 +46,5 @@ export const getApiAccessLogPageApi = (params: ApiAccessLogPageReqVO) => { // 导出API 访问日志 export const exportApiAccessLogApi = (params: ApiAccessLogExportReqVO) => { - return defHttp.download({ url: '/infra/api-access-log/export-excel', params }) + return defHttp.download({ url: '/infra/api-access-log/export-excel', params }, '访问日志.xls') } diff --git a/src/api/infra/apiErrorLog/index.ts b/src/api/infra/apiErrorLog/index.ts index 09ec82e4..58f30007 100644 --- a/src/api/infra/apiErrorLog/index.ts +++ b/src/api/infra/apiErrorLog/index.ts @@ -57,10 +57,13 @@ export const updateApiErrorLogPageApi = (id: number, processStatus: number) => { }) } -// 导出API 访问日志 +// 导出API 错误日志 export const exportApiErrorLogApi = (params: ApiErrorLogExportReqVO) => { - return defHttp.download({ - url: '/infra/api-error-log/export-excel', - params - }) + return defHttp.download( + { + url: '/infra/api-error-log/export-excel', + params + }, + '错误日志.xls' + ) } diff --git a/src/api/infra/codegen/index.ts b/src/api/infra/codegen/index.ts index 7f87e567..8c39aa0b 100644 --- a/src/api/infra/codegen/index.ts +++ b/src/api/infra/codegen/index.ts @@ -38,7 +38,7 @@ export const previewCodegenApi = (id: number) => { // 下载生成代码 export const downloadCodegenApi = (id: number) => { - return defHttp.download({ url: '/infra/codegen/download?tableId=' + id }) + return defHttp.download({ url: '/infra/codegen/download?tableId=' + id }, '生成代码.zip') } // 获得表定义 diff --git a/src/api/infra/config/index.ts b/src/api/infra/config/index.ts index b6bff665..e65851c6 100644 --- a/src/api/infra/config/index.ts +++ b/src/api/infra/config/index.ts @@ -58,5 +58,5 @@ export const deleteConfigApi = (id: number) => { // 导出参数 export const exportConfigApi = (params: ConfigExportReqVO) => { - return defHttp.download({ url: '/infra/config/export', params }) + return defHttp.download({ url: '/infra/config/export', params }, '参数.xls') } diff --git a/src/api/infra/dbDoc/index.ts b/src/api/infra/dbDoc/index.ts index b8ebb7c1..c7154075 100644 --- a/src/api/infra/dbDoc/index.ts +++ b/src/api/infra/dbDoc/index.ts @@ -2,15 +2,15 @@ import { defHttp } from '@/utils/http/axios' // 导出Html export const exportHtmlApi = () => { - return defHttp.download({ url: '/infra/db-doc/export-html' }) + return defHttp.download({ url: '/infra/db-doc/export-html' }, '数据库.html') } // 导出Word export const exportWordApi = () => { - return defHttp.download({ url: '/infra/db-doc/export-word' }) + return defHttp.download({ url: '/infra/db-doc/export-word' }, '数据库.doc') } // 导出Markdown export const exportMarkdownApi = () => { - return defHttp.download({ url: '/infra/db-doc/export-markdown' }) + return defHttp.download({ url: '/infra/db-doc/export-markdown' }, '数据库.md') } diff --git a/src/api/infra/job/index.ts b/src/api/infra/job/index.ts index 1a458dc7..aacbebdf 100644 --- a/src/api/infra/job/index.ts +++ b/src/api/infra/job/index.ts @@ -52,7 +52,7 @@ export const deleteJobApi = (id: number) => { // 导出定时任务调度 export const exportJobApi = (params: JobExportReqVO) => { - return defHttp.download({ url: '/infra/job/export-excel', params }) + return defHttp.download({ url: '/infra/job/export-excel', params }, '定时任务.xls') } // 任务状态修改 diff --git a/src/api/infra/jobLog/index.ts b/src/api/infra/jobLog/index.ts index 1f5e3add..3e538e3a 100644 --- a/src/api/infra/jobLog/index.ts +++ b/src/api/infra/jobLog/index.ts @@ -42,8 +42,11 @@ export const getJobLogApi = (id: number) => { // 导出定时任务日志 export const exportJobLogApi = (params: JobLogExportReqVO) => { - return defHttp.download({ - url: '/infra/job-log/export-excel', - params - }) + return defHttp.download( + { + url: '/infra/job-log/export-excel', + params + }, + '定时任务日志.xls' + ) } diff --git a/src/api/pay/app/index.ts b/src/api/pay/app/index.ts index f1205737..593d82d6 100644 --- a/src/api/pay/app/index.ts +++ b/src/api/pay/app/index.ts @@ -69,7 +69,7 @@ export const deleteAppApi = (id: number) => { // 导出支付应用 export const exportAppApi = (params: AppExportReqVO) => { - return defHttp.download({ url: '/pay/app/export-excel', params }) + return defHttp.download({ url: '/pay/app/export-excel', params }, '支付应用.xls') } // 根据商ID称搜索应用列表 diff --git a/src/api/pay/channel/index.ts b/src/api/pay/channel/index.ts index 311590a6..cfc3a1f7 100644 --- a/src/api/pay/channel/index.ts +++ b/src/api/pay/channel/index.ts @@ -66,5 +66,5 @@ export const deleteChannelApi = (id: number) => { // 导出支付渠道 export const exportChannelApi = (params: ChannelExportReqVO) => { - return defHttp.download({ url: '/pay/channel/export-excel', params }) + return defHttp.download({ url: '/pay/channel/export-excel', params }, '支付渠道.xls') } diff --git a/src/api/pay/merchant/index.ts b/src/api/pay/merchant/index.ts index 75bb1d82..55469556 100644 --- a/src/api/pay/merchant/index.ts +++ b/src/api/pay/merchant/index.ts @@ -65,7 +65,7 @@ export const deleteMerchantApi = (id: number) => { // 导出支付商户 export const exportMerchantApi = (params: MerchantExportReqVO) => { - return defHttp.download({ url: '/pay/merchant/export-excel', params }) + return defHttp.download({ url: '/pay/merchant/export-excel', params }, '支付商户.xls') } // 支付商户状态修改 export const changeMerchantStatusApi = (id: number, status: number) => { diff --git a/src/api/pay/order/index.ts b/src/api/pay/order/index.ts index fd6b10e6..65f94a4d 100644 --- a/src/api/pay/order/index.ts +++ b/src/api/pay/order/index.ts @@ -105,5 +105,5 @@ export const deleteOrderApi = async (id: number) => { // 导出支付订单 export const exportOrderApi = async (params: OrderExportReqVO) => { - return defHttp.download({ url: '/pay/order/export-excel', params }) + return defHttp.download({ url: '/pay/order/export-excel', params }, '支付订单.xls') } diff --git a/src/api/pay/refund/index.ts b/src/api/pay/refund/index.ts index b092b5ba..86b9b8a5 100644 --- a/src/api/pay/refund/index.ts +++ b/src/api/pay/refund/index.ts @@ -112,5 +112,5 @@ export const deleteRefundApi = (id: number) => { // 导出退款订单 export const exportRefundApi = (params: PayRefundExportReqVO) => { - return defHttp.download({ url: '/pay/refund/export-excel', params }) + return defHttp.download({ url: '/pay/refund/export-excel', params }, '退款订单.xls') } diff --git a/src/api/system/errorCode/index.ts b/src/api/system/errorCode/index.ts index 582bc91f..e96c8885 100644 --- a/src/api/system/errorCode/index.ts +++ b/src/api/system/errorCode/index.ts @@ -45,5 +45,5 @@ export const deleteErrorCodeApi = (id: number) => { // 导出错误码 export const excelErrorCodeApi = (params: ErrorCodePageReqVO) => { - return defHttp.download({ url: '/system/error-code/export-excel', params }) + return defHttp.download({ url: '/system/error-code/export-excel', params }, '错误码.xls') } diff --git a/src/api/system/loginLog/index.ts b/src/api/system/loginLog/index.ts index 817c1f97..fd9255e1 100644 --- a/src/api/system/loginLog/index.ts +++ b/src/api/system/loginLog/index.ts @@ -26,5 +26,5 @@ export const getLoginLogPageApi = (params: LoginLogReqVO) => { } // 导出登录日志 export const exportLoginLogApi = (params: LoginLogReqVO) => { - return defHttp.download({ url: '/system/login-log/export', params }) + return defHttp.download({ url: '/system/login-log/export', params }, '登录日志.xls') } diff --git a/src/api/system/operatelog/index.ts b/src/api/system/operatelog/index.ts index 56ea09e1..ad64be7d 100644 --- a/src/api/system/operatelog/index.ts +++ b/src/api/system/operatelog/index.ts @@ -37,5 +37,5 @@ export const getOperateLogPageApi = (params: OperateLogPageReqVO) => { } // 导出操作日志 export const exportOperateLogApi = (params: OperateLogPageReqVO) => { - return defHttp.download({ url: '/system/operate-log/export', params }) + return defHttp.download({ url: '/system/operate-log/export', params }, '操作日志.xls') } diff --git a/src/api/system/sensitiveWord/index.ts b/src/api/system/sensitiveWord/index.ts index c0df5473..843d4f06 100644 --- a/src/api/system/sensitiveWord/index.ts +++ b/src/api/system/sensitiveWord/index.ts @@ -50,7 +50,7 @@ export const deleteSensitiveWordApi = (id: number) => { // 导出敏感词 export const exportSensitiveWordApi = (params: SensitiveWordExportReqVO) => { - return defHttp.download({ url: '/system/sensitive-word/export-excel', params }) + return defHttp.download({ url: '/system/sensitive-word/export-excel', params }, '导出敏感词.xls') } // 获取所有敏感词的标签数组 diff --git a/src/api/system/sms/smsLog/index.ts b/src/api/system/sms/smsLog/index.ts index d3a55690..d4f4afe4 100644 --- a/src/api/system/sms/smsLog/index.ts +++ b/src/api/system/sms/smsLog/index.ts @@ -53,5 +53,5 @@ export const getSmsLogPageApi = (params: SmsLogPageReqVO) => { // 导出短信日志 export const exportSmsLogApi = (params: SmsLogExportReqVO) => { - return defHttp.download({ url: '/system/sms-log/export', params }) + return defHttp.download({ url: '/system/sms-log/export', params }, '短信日志.xls') } diff --git a/src/api/system/sms/smsTemplate/index.ts b/src/api/system/sms/smsTemplate/index.ts index 6c70f26f..eb5d13f9 100644 --- a/src/api/system/sms/smsTemplate/index.ts +++ b/src/api/system/sms/smsTemplate/index.ts @@ -73,5 +73,5 @@ export const sendSmsApi = (data: SendSmsReqVO) => { // 导出短信模板 export const exportPostApi = (params: SmsTemplateExportReqVO) => { - return defHttp.download({ url: '/system/sms-template/export-excel', params }) + return defHttp.download({ url: '/system/sms-template/export-excel', params }, '短信模板.xls') } diff --git a/src/api/system/tenant/index.ts b/src/api/system/tenant/index.ts index c20245bc..fde24d0d 100644 --- a/src/api/system/tenant/index.ts +++ b/src/api/system/tenant/index.ts @@ -58,5 +58,5 @@ export const deleteTenantApi = (id: number) => { // 导出租户 export const exportTenantApi = (params: TenantExportReqVO) => { - return defHttp.download({ url: '/system/tenant/export-excel', params }) + return defHttp.download({ url: '/system/tenant/export-excel', params }, '租户.xls') } diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 8d457eca..55db0880 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -59,12 +59,12 @@ export const deleteUserApi = (id: number) => { // 导出用户 export const exportUserApi = (params: UserExportReqVO) => { - return defHttp.download({ url: '/system/user/export', params }) + return defHttp.download({ url: '/system/user/export', params }, '用户.xls') } // 下载用户导入模板 export const importUserTemplateApi = () => { - return defHttp.download({ url: '/system/user/get-import-template' }) + return defHttp.download({ url: '/system/user/get-import-template' }, '用户导入模板.xls') } // 用户密码重置