Ver Fonte

1.新增模版下载接口

liziliang há 6 dias atrás
pai
commit
2ef9edad6a
1 ficheiros alterados com 13 adições e 0 exclusões
  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) => {