浏览代码

Add authorization header to download function in alarm module

valentichu 11 月之前
父节点
当前提交
06aa6af880
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 0 0
      lib/index.js
  2. 3 0
      src/api/alarm.js

文件差异内容过多而无法显示
+ 0 - 0
lib/index.js


+ 3 - 0
src/api/alarm.js

@@ -68,6 +68,9 @@ export async function download(url) {
     baseURL: getConfig().baseURL,
     noNeedInterceptor: true,
     responseType: "blob",
+    headers: {
+      Authorization: localStorage.getItem("token"),
+    },
   };
   const res = await axios.get(url, newConfig);
   return res;

部分文件因为文件数量过多而无法显示