瀏覽代碼

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;

部分文件因文件數量過多而無法顯示