feat: 模型管理独立页与会话级选模型

This commit is contained in:
2026-09-20 15:42:25 +08:00
parent ffb8d5f7dc
commit aac3424911
24 changed files with 845 additions and 523 deletions
@@ -41,6 +41,14 @@ describe('requestClient', () => {
expect(response.data).toEqual(mockData);
});
it('should successfully make a PATCH request', async () => {
const patchData = { key: 'patchedValue' };
const mockData = { data: 'patched response' };
mock.onPatch('/test/patch', patchData).reply(200, mockData);
const response = await requestClient.patch('/test/patch', patchData);
expect(response.data).toEqual(mockData);
});
it('should successfully make a DELETE request', async () => {
const mockData = { data: 'delete response' };
mock.onDelete('/test/delete').reply(200, mockData);
@@ -94,6 +102,6 @@ describe('requestClient', () => {
const res = await requestClient.download('/test/download');
expect(res.data).toBeInstanceOf(Blob);
expect(res).toBeInstanceOf(Blob);
});
});
@@ -125,6 +125,17 @@ class RequestClient {
return this.request<T>(url, { ...config, data, method: 'PUT' });
}
/**
* PATCH请求方法
*/
public patch<T = any>(
url: string,
data?: any,
config?: RequestClientConfig,
): Promise<T> {
return this.request<T>(url, { ...config, data, method: 'PATCH' });
}
/**
* 通用的请求方法
*/