perf: api key (#342)

This commit is contained in:
Archer
2023-09-23 20:28:03 +08:00
committed by GitHub
parent 814c5b3d3c
commit a4ff5a3f73
59 changed files with 1030 additions and 677 deletions

View File

@@ -0,0 +1,26 @@
import { GET, POST, DELETE } from '@/api/request';
import { EditApiKeyProps, GetApiKeyProps } from './index.d';
import type { OpenApiSchema } from '@/types/support/openapi';
/**
* crete a api key
*/
export const createAOpenApiKey = (data: EditApiKeyProps) =>
POST<string>('/support/openapi/postKey', data);
/**
* update a api key
*/
export const putOpenApiKey = (data: EditApiKeyProps & { _id: string }) =>
POST<string>('/support/openapi/putKey', data);
/**
* get api keys
*/
export const getOpenApiKeys = (params?: GetApiKeyProps) =>
GET<OpenApiSchema[]>('/support/openapi/getKeys', params);
/**
* delete api by id
*/
export const delOpenApiById = (id: string) => DELETE(`/support/openapi/delKey?id=${id}`);