fix: 修复记录时间
This commit is contained in:
@@ -303,8 +303,8 @@ const fetchStockPriceRecords = async () => {
|
||||
|
||||
// 计算时间范围: 今天的近5个小时
|
||||
const now = dayjs();
|
||||
const endTime = now.format('YYYY-MM-DD HH:00');
|
||||
const startTime = now.subtract(5, 'hour').format('YYYY-MM-DD HH:00');
|
||||
const endTime = now.format('YYYY-MM-DD HH:00:00');
|
||||
const startTime = now.subtract(24, 'hour').format('YYYY-MM-DD HH:00:00');
|
||||
|
||||
// 获取当前选中股票的ID
|
||||
// 注意:这里假设stockList中的id就是后端的stockId,如果不是需要调整
|
||||
@@ -316,8 +316,7 @@ const fetchStockPriceRecords = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// const { data } = await getStockPriceRecords(stockId, startTime, endTime);
|
||||
const { data } = await getStockPriceRecords(stockId, '2025-03-08 21:00', '2025-03-09 21:00');
|
||||
const { data } = await getStockPriceRecords(stockId, startTime, endTime);
|
||||
// 将API返回的数据映射到图表所需的格式
|
||||
stockChartData.value = (data.items || []).map(item => ({
|
||||
date: dayjs(item.recordTime).format('MM-DD HH'),
|
||||
|
||||
Reference in New Issue
Block a user