From 34a52a174bbb5aad029a491b2ef9cfce49522ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=93=E5=BA=B7?= Date: Mon, 13 Nov 2023 19:34:50 +0800 Subject: [PATCH] update to v2 --- src/common/network/recycle.ts | 12 ++++++------ src/store/sessionManager/session.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/network/recycle.ts b/src/common/network/recycle.ts index 5f80fbc3e..cebf96287 100644 --- a/src/common/network/recycle.ts +++ b/src/common/network/recycle.ts @@ -22,12 +22,12 @@ import { generateDatabaseSid, generateSessionSid } from './pathUtil'; * 获取回收站保留时间 */ export async function getRecyleKeepTime() { - const res = await request.get(`/api/v1/recyclebin/getExpireTime/${generateSessionSid()}`); + const res = await request.get(`/api/v2/recyclebin/getExpireTime/${generateSessionSid()}`); return res?.data; } export async function getRecycleConfig(sessionId: string): Promise { - const res = await request.get(`/api/v1/recyclebin/settings/${generateSessionSid(sessionId)}`); + const res = await request.get(`/api/v2/recyclebin/settings/${generateSessionSid(sessionId)}`); return res?.data; } @@ -35,7 +35,7 @@ export async function updateRecycleConfig( config: Partial, sessionId: string, ): Promise { - const res = await request.patch(`/api/v1/recyclebin/settings`, { + const res = await request.patch(`/api/v2/recyclebin/settings`, { data: { sessionIds: [sessionId], settings: config, @@ -46,7 +46,7 @@ export async function updateRecycleConfig( export async function getPurgeAllSQL(sessionId: string, dbName: string) { const result = await request.patch( - `/api/v1/recyclebin/purgeAll/${generateDatabaseSid(dbName, sessionId)}`, + `/api/v2/recyclebin/purgeAll/${generateDatabaseSid(dbName, sessionId)}`, ); return !!result?.data; } @@ -57,7 +57,7 @@ export async function getDeleteSQL( dbName: string, ) { const sid = generateDatabaseSid(dbName, sessionId); - const result = await request.patch(`/api/v1/recyclebin/purge/${sid}`, { + const result = await request.patch(`/api/v2/recyclebin/purge/${sid}`, { data: recycleObjects, }); return !!result?.data; @@ -69,7 +69,7 @@ export async function getUpdateSQL( dbName: string, ) { const sid = generateDatabaseSid(dbName, sessionId); - const result = await request.patch(`/api/v1/recyclebin/flashback/${sid}`, { + const result = await request.patch(`/api/v2/recyclebin/flashback/${sid}`, { data: recycleObjects, }); return !!result?.data; diff --git a/src/store/sessionManager/session.ts b/src/store/sessionManager/session.ts index 9f5f5151d..3739f36f5 100644 --- a/src/store/sessionManager/session.ts +++ b/src/store/sessionManager/session.ts @@ -358,7 +358,7 @@ class SessionStore { @action public async getRecycleObjectList() { // ListRecycleObjects - const res = await request.get(`/api/v1/recyclebin/list/${generateSessionSid(this.sessionId)}`); + const res = await request.get(`/api/v2/recyclebin/list/${generateSessionSid(this.sessionId)}`); const recycleObjects = res?.data || []; this.recycleObjects = recycleObjects.map((r: IRecycleObject, i: number) => ({ ...r,