Sfoglia il codice sorgente

请求添加lang header

Zimo 5 ore fa
parent
commit
0cab7206a9
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      src/config/axios/index.ts

+ 4 - 0
src/config/axios/index.ts

@@ -6,10 +6,14 @@ const { default_headers } = config
 
 const request = (option: any) => {
   const { headersType, headers, ...otherOption } = option
+
+  const langStore = JSON.parse(localStorage.getItem('lang') || '{}')
+
   return service({
     ...otherOption,
     headers: {
       'Content-Type': headersType || default_headers,
+      Lang: langStore.v,
       ...headers
     }
   })