|
|
@ -1,9 +1,12 @@ |
|
|
|
import { service } from './service' |
|
|
|
|
|
|
|
import { config } from './config' |
|
|
|
import { useCache } from '@/hooks/web/useCache' |
|
|
|
|
|
|
|
const { default_headers } = config |
|
|
|
|
|
|
|
const { wsCache } = useCache() |
|
|
|
console.log('lang='+wsCache.get('lang')); |
|
|
|
const language = wsCache.get('lang') |
|
|
|
const request = (option: any) => { |
|
|
|
const { url, method, params, data, headersType, responseType, ...config } = option |
|
|
|
return service({ |
|
|
@ -14,7 +17,8 @@ const request = (option: any) => { |
|
|
|
...config, |
|
|
|
responseType: responseType, |
|
|
|
headers: { |
|
|
|
'Content-Type': headersType || default_headers |
|
|
|
'Content-Type': headersType || default_headers, |
|
|
|
'language': language |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|