index.ts 1007 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import request from '@/config/axios'
  2. // AI API 密钥 VO
  3. export interface ApiKeyVO {
  4. id: number // 编号
  5. name: string // 名称
  6. apiKey: string // 密钥
  7. platform: string // 平台
  8. url: string // 自定义 API 地址
  9. status: number // 状态
  10. }
  11. // AI API 密钥 API
  12. export const ApiKeyApi = {
  13. // 查询 API 密钥分页
  14. getApiKeyPage: async (params: any) => {
  15. return await request.get({ url: `/ai/api-key/page`, params })
  16. },
  17. // 查询 API 密钥详情
  18. getApiKey: async (id: number) => {
  19. return await request.get({ url: `/ai/api-key/get?id=` + id })
  20. },
  21. // 新增 API 密钥
  22. createApiKey: async (data: ApiKeyVO) => {
  23. return await request.post({ url: `/ai/api-key/create`, data })
  24. },
  25. // 修改 API 密钥
  26. updateApiKey: async (data: ApiKeyVO) => {
  27. return await request.put({ url: `/ai/api-key/update`, data })
  28. },
  29. // 删除 API 密钥
  30. deleteApiKey: async (id: number) => {
  31. return await request.delete({ url: `/ai/api-key/delete?id=` + id })
  32. }
  33. }