|
@@ -119,7 +119,9 @@ service.interceptors.request.use(
|
|
|
* params: { data, params, raw }
|
|
|
* content
|
|
|
*/
|
|
|
- if (import.meta.env.VITE_USER_NODE_ENV === 'production' && systemInfo.beijingTimestamp === 0) {
|
|
|
+ const env = import.meta.env.VITE_USER_NODE_ENV
|
|
|
+ console.log(env)
|
|
|
+ if (env === 'production' && systemInfo.beijingTimestamp === 0) {
|
|
|
const _timestamp = await getBeijingTimestamp()
|
|
|
setBeijingTimestamp(_timestamp)
|
|
|
}
|
|
@@ -130,7 +132,7 @@ service.interceptors.request.use(
|
|
|
appId: 'web_client',
|
|
|
AppSecret: 'fa0fc0b5098b974b',
|
|
|
// timestamp: 1735282548997,
|
|
|
- timestamp: import.meta.env.VITE_USER_NODE_ENV === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
|
|
|
+ timestamp: env === 'production' ? systemInfo.beijingTimestamp : new Date().getTime(),
|
|
|
})
|
|
|
const content = {
|
|
|
data: config.data,
|
|
@@ -274,14 +276,15 @@ service.interceptors.response.use(
|
|
|
}
|
|
|
const _index = errorData.findIndex(e => e.url === config.url && e.time === +config.headers.timestamp)
|
|
|
if (_index > -1) {
|
|
|
- const _spliceItem = errorData.splice(_index, 1)
|
|
|
- const _item = _spliceItem[0]
|
|
|
-
|
|
|
+ const _d = errorData.splice(_index, 1)
|
|
|
+ // const _item = JSON.parse(JSON.stringify(errorData[_index]))
|
|
|
+ const _item = _d[0]
|
|
|
// 保存错误信息
|
|
|
if (code === 400) {
|
|
|
sendError({ content: JSON.stringify(_item.content), mark: _item.time + '' })
|
|
|
}
|
|
|
}
|
|
|
+ // errorData.splice(_index, 1)
|
|
|
if (code !== 200) {
|
|
|
Snackbar.error(msg)
|
|
|
return Promise.reject(msg)
|