Przeglądaj źródła

Add authorization header to download function in alarm module

valentichu 11 miesięcy temu
rodzic
commit
06aa6af880
2 zmienionych plików z 3 dodań i 0 usunięć
  1. 0 0
      lib/index.js
  2. 3 0
      src/api/alarm.js

Plik diff jest za duży
+ 0 - 0
lib/index.js


+ 3 - 0
src/api/alarm.js

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

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików