feat: Minecraft theme overhaul, fix points bug, add history
这个提交包含在:
@@ -9,8 +9,8 @@ function uiText(zhText: string, enText: string): string {
|
||||
}
|
||||
|
||||
type ApiEnvelope<T> =
|
||||
| { ok: true; data?: T; [k: string]: unknown }
|
||||
| { ok: false; error?: string; [k: string]: unknown };
|
||||
| { ok: true; data?: T;[k: string]: unknown }
|
||||
| { ok: false; error?: string;[k: string]: unknown };
|
||||
|
||||
export async function apiFetch<T>(
|
||||
path: string,
|
||||
@@ -52,11 +52,9 @@ export async function apiFetch<T>(
|
||||
} catch (retryErr) {
|
||||
throw new Error(
|
||||
uiText(
|
||||
`网络请求失败,请检查后端服务或代理连接(${
|
||||
retryErr instanceof Error ? retryErr.message : String(retryErr)
|
||||
`网络请求失败,请检查后端服务或代理连接(${retryErr instanceof Error ? retryErr.message : String(retryErr)
|
||||
})`,
|
||||
`Network request failed. Please check backend/proxy connectivity (${
|
||||
retryErr instanceof Error ? retryErr.message : String(retryErr)
|
||||
`Network request failed. Please check backend/proxy connectivity (${retryErr instanceof Error ? retryErr.message : String(retryErr)
|
||||
}).`
|
||||
)
|
||||
);
|
||||
@@ -92,3 +90,14 @@ export async function apiFetch<T>(
|
||||
|
||||
return payload as T;
|
||||
}
|
||||
|
||||
export interface RatingHistoryItem {
|
||||
type: string;
|
||||
created_at: number;
|
||||
change: number;
|
||||
note: string;
|
||||
}
|
||||
|
||||
export async function listRatingHistory(limit: number = 100): Promise<RatingHistoryItem[]> {
|
||||
return apiFetch<RatingHistoryItem[]>(`/api/v1/me/rating-history?limit=${limit}`);
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户