@ -78,7 +78,7 @@ export function recordHistory(id: string): void {
|
||||
setLocal(list)
|
||||
|
||||
if (serverMode()) {
|
||||
authJson("POST", "/auth/history", { target_uid: id }).catch(() => {
|
||||
authJson("POST", "/me/history", { target_uid: id }).catch(() => {
|
||||
/* 失败不回滚本地 */
|
||||
})
|
||||
}
|
||||
@ -102,7 +102,7 @@ export async function fetchHistoryPage(page = 1, perPage = 24): Promise<HistPage
|
||||
const qs = `page=${page}&per_page=${perPage}`
|
||||
const r = await authJson<{ items: ServerHistory[]; total: number; last_page: number }>(
|
||||
"GET",
|
||||
`/auth/history?${qs}`,
|
||||
`/me/history?${qs}`,
|
||||
)
|
||||
const base: HistoryEntry[] = (r?.items ?? []).map((it) => ({
|
||||
id: String(it.id),
|
||||
@ -131,7 +131,7 @@ export async function fetchHistoryPage(page = 1, perPage = 24): Promise<HistPage
|
||||
export function removeHistory(id: string): void {
|
||||
setLocal(getLocal().filter((h) => h.id !== id))
|
||||
if (serverMode()) {
|
||||
authJson("DELETE", `/auth/history/${encodeURIComponent(id)}`).catch(() => {
|
||||
authJson("DELETE", `/me/history/${encodeURIComponent(id)}`).catch(() => {
|
||||
/* 失败不回滚本地 */
|
||||
})
|
||||
}
|
||||
@ -141,7 +141,7 @@ export function removeHistory(id: string): void {
|
||||
export function clearHistory(): void {
|
||||
setLocal([])
|
||||
if (serverMode()) {
|
||||
authJson("DELETE", "/auth/history").catch(() => {
|
||||
authJson("DELETE", "/me/history").catch(() => {
|
||||
/* 失败不回滚本地 */
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user