feat: 管理后台接真实接口并加 Playwright e2e
This commit is contained in:
+4
-4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user