feat: 管理后台接真实接口并加 Playwright e2e

This commit is contained in:
Nixevol
2026-09-30 09:20:01 +08:00
parent a22912d95a
commit b75b67928b
24 changed files with 1299 additions and 71 deletions
+4 -4
View File
@@ -98,7 +98,7 @@ const registration: RegistrationSettings = {
const tokens: ApiToken[] = [
{
id: 1,
id: "1",
name: "ops",
enabled: true,
created_at_ms: now() - 86_400_000,
@@ -557,7 +557,7 @@ export const mockApi = {
async createToken(name: string): Promise<ApiTokenCreateResult> {
requireSession();
const item: ApiToken = {
id: nextTokenId++,
id: String(nextTokenId++),
name,
enabled: true,
created_at_ms: now(),
@@ -572,7 +572,7 @@ export const mockApi = {
};
},
async patchToken(id: number, body: { name?: string; enabled?: boolean }): Promise<ApiToken> {
async patchToken(id: string, body: { name?: string; enabled?: boolean }): Promise<ApiToken> {
requireSession();
const t = tokens.find((x) => x.id === id);
if (!t) {
@@ -583,7 +583,7 @@ export const mockApi = {
return clone(t);
},
async deleteToken(id: number): Promise<Record<string, never>> {
async deleteToken(id: string): Promise<Record<string, never>> {
requireSession();
const idx = tokens.findIndex((x) => x.id === id);
if (idx < 0) {