fix(web): 修复图片上传、自动保存竞态、登录竞态并统一失效公共缓存

FormData 不强设 Content-Type(P1-2),补 api 客户端回归测试; 自动保存成功仅失效列表与公共键,防详情 refetch 回滚输入(P1-4); login/logout 以请求序号丢弃迟到 /api/me 响应,401 统一回调跳登录(P2-15); 首页不硬编码 page_size,写操作后统一 invalidatePublic,TagPage 补 error 分支(P2-15)。
This commit is contained in:
2026-09-08 17:32:57 +08:00
parent 3105b0415c
commit b94e9b1721
10 changed files with 136 additions and 10 deletions
+2 -1
View File
@@ -7,7 +7,8 @@ import type { NoteItem, NoteList, TagCount } from '../lib/api'
import { formatDate } from '../lib/utils'
function useNotes(page: number, tag?: string) {
const qs = new URLSearchParams({ page: String(page), page_size: '10' })
// 不传 page_size:服务端默认值即站点设置(管理员可改),首页随设置生效
const qs = new URLSearchParams({ page: String(page) })
if (tag) qs.set('tag', tag)
return useQuery({
queryKey: ['notes', page, tag ?? ''],