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