|
|
|
|
@ -14,6 +14,8 @@ import store from '@/store'
|
|
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
|
|
import SettingMer from '@/utils/settingMer'
|
|
|
|
|
import { isPhone } from "@/libs/wechat";
|
|
|
|
|
import JsonBigint from 'json-bigint'
|
|
|
|
|
const JSONbigString = JsonBigint({ storeAsString: true });
|
|
|
|
|
const service = axios.create({
|
|
|
|
|
baseURL: SettingMer.apiBaseURL,
|
|
|
|
|
timeout: 60000 // 过期时间
|
|
|
|
|
@ -31,6 +33,16 @@ service.interceptors.request.use(
|
|
|
|
|
config.params = config.params || {}
|
|
|
|
|
config.params.temp= Date.parse(new Date()) / 1000
|
|
|
|
|
}
|
|
|
|
|
config.transformResponse = [
|
|
|
|
|
function (data) {
|
|
|
|
|
try {
|
|
|
|
|
return JSONbigString.parse(data);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// console.log('错误', error);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
return config
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
|