fix(api): increase request timeout and format latest update date
- Update API request timeout from 60 seconds to 120 seconds for improved performance. - Format latest update date to append 'Z' if it exists, ensuring consistency in date handling.
This commit is contained in:
@@ -6,7 +6,7 @@ import axios from 'axios'
|
||||
*/
|
||||
const api = axios.create({
|
||||
baseURL: 'http://localhost:3000', // 设置后端服务地址
|
||||
timeout: 60000, // 请求超时时间(60秒)
|
||||
timeout: 120000, // 请求超时时间(120秒)
|
||||
})
|
||||
|
||||
// 请求拦截器
|
||||
|
||||
@@ -180,7 +180,7 @@ export class BidsService {
|
||||
return results.map((item) => ({
|
||||
source: String(item.source),
|
||||
count: Number(item.count),
|
||||
latestUpdate: item.latestUpdate,
|
||||
latestUpdate: item.latestUpdate ? item.latestUpdate + 'Z' : null,
|
||||
latestPublishDate: item.latestPublishDate,
|
||||
// 确保 error 字段正确处理:null 或空字符串都转换为 null,非空字符串保留
|
||||
error:
|
||||
|
||||
Reference in New Issue
Block a user