Pārlūkot izejas kodu

1.新增模版下载接口

liziliang 6 dienas atpakaļ
vecāks
revīzija
2ef9edad6a
1 mainītis faili ar 13 papildinājumiem un 0 dzēšanām
  1. 13 0
      src/hooks/userCrud.ts

+ 13 - 0
src/hooks/userCrud.ts

@@ -404,6 +404,19 @@ export const useCrud = (config?: UseCrudConfig) => {
     },
 
     /**
+     * 下载模版 传入url
+     */
+    downloadSPCTemplate: async (urlStr: string, filePath: string) => {
+      const response = await request({
+        url: urlStr,
+        method: "get",
+        params: {filePath},
+        responseType: "arraybuffer",
+      });
+      Utils.downloadFile(response);
+    },
+
+    /**
      * 根据搜索项导出数据
      */
     exportData: async (urlStr: string) => {