index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import type { PageParam, PageResult } from '@/http/types'
  2. import { http } from '@/http/http'
  3. /** OAuth2.0 客户端信息 */
  4. export interface OAuth2Client {
  5. id?: number
  6. clientId: string
  7. secret: string
  8. name: string
  9. logo: string
  10. description: string
  11. status: number
  12. accessTokenValiditySeconds: number
  13. refreshTokenValiditySeconds: number
  14. redirectUris: string[]
  15. autoApprove: boolean
  16. authorizedGrantTypes: string[]
  17. scopes: string[]
  18. authorities: string[]
  19. resourceIds: string[]
  20. additionalInformation: string
  21. createTime?: Date
  22. }
  23. /** 获取 OAuth2.0 客户端分页列表 */
  24. export function getOAuth2ClientPage(params: PageParam) {
  25. return http.get<PageResult<OAuth2Client>>('/system/oauth2-client/page', params)
  26. }
  27. /** 获取 OAuth2.0 客户端详情 */
  28. export function getOAuth2Client(id: number) {
  29. return http.get<OAuth2Client>(`/system/oauth2-client/get?id=${id}`)
  30. }
  31. /** 创建 OAuth2.0 客户端 */
  32. export function createOAuth2Client(data: OAuth2Client) {
  33. return http.post<number>('/system/oauth2-client/create', data)
  34. }
  35. /** 更新 OAuth2.0 客户端 */
  36. export function updateOAuth2Client(data: OAuth2Client) {
  37. return http.put<boolean>('/system/oauth2-client/update', data)
  38. }
  39. /** 删除 OAuth2.0 客户端 */
  40. export function deleteOAuth2Client(id: number) {
  41. return http.delete<boolean>(`/system/oauth2-client/delete?id=${id}`)
  42. }