Browse Source

1.新增模版下载接口

liziliang 6 ngày trước cách đây
mục cha
commit
2ef9edad6a
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  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) => {