feat: 更新hook fetch 库

This commit is contained in:
ccnetcore
2025-06-28 23:07:32 +08:00
parent 5383d2d40e
commit 216b57a4c7
14 changed files with 34 additions and 27 deletions

View File

@@ -178,7 +178,7 @@ export const useSessionStore = defineStore('session', () => {
// 删除会话(供组件调用)
const deleteSessions = async (ids: string[]) => {
try {
//todo cc这里删除返回空的body结果炸了报错堆栈都没有
// todo cc这里删除返回空的body结果炸了报错堆栈都没有
await delete_session(ids);
// 1. 先找到被修改会话在 sessionList 中的索引(假设 sessionList 是按服务端排序的完整列表)
const targetIndex = sessionList.value.findIndex(session => session.id === ids[0]);
@@ -200,7 +200,7 @@ export const useSessionStore = defineStore('session', () => {
const currentDate = new Date();
return sessions.map((session) => {
const createDate = new Date(session.createTime!);
const createDate = new Date(session.creationTime!);
const diffDays = Math.floor(
(currentDate.getTime() - createDate.getTime()) / (1000 * 60 * 60 * 24),
);