浏览代码

请求添加lang header

Zimo 12 小时之前
父节点
当前提交
0cab7206a9
共有 1 个文件被更改,包括 4 次插入0 次删除
  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
     }
   })