mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-11 16:57:09 +08:00
refactor: 优化认证及客户端相关代码
This commit is contained in:
@@ -1,77 +1,31 @@
|
||||
import type * as T from './type'
|
||||
import http from '@/utils/http'
|
||||
|
||||
export type * from './type'
|
||||
|
||||
const BASE_URL = '/system/client'
|
||||
|
||||
export interface ClientResp {
|
||||
id: string
|
||||
clientId: string
|
||||
clientKey: string
|
||||
clientSecret: string
|
||||
authType: string
|
||||
clientType: string
|
||||
activeTimeout: string
|
||||
timeout: string
|
||||
status: string
|
||||
createUser: string
|
||||
createTime: string
|
||||
updateUser: string
|
||||
updateTime: string
|
||||
createUserString: string
|
||||
updateUserString: string
|
||||
}
|
||||
export interface ClientDetailResp {
|
||||
id: string
|
||||
clientId: string
|
||||
clientKey: string
|
||||
clientSecret: string
|
||||
authType: string
|
||||
clientType: string
|
||||
activeTimeout: string
|
||||
timeout: string
|
||||
status: string
|
||||
createUser: string
|
||||
createTime: string
|
||||
updateUser: string
|
||||
updateTime: string
|
||||
createUserString: string
|
||||
updateUserString: string
|
||||
}
|
||||
export interface ClientQuery {
|
||||
clientKey: string
|
||||
clientSecret: string
|
||||
authType: string[]
|
||||
clientType: string
|
||||
status: string
|
||||
sort: Array<string>
|
||||
}
|
||||
export interface ClientPageQuery extends ClientQuery, PageQuery {}
|
||||
|
||||
/** @desc 查询系统授权列表 */
|
||||
export function listClient(query: ClientPageQuery) {
|
||||
return http.get<PageRes<ClientResp[]>>(`${BASE_URL}`, query)
|
||||
/** @desc 查询客户端列表 */
|
||||
export function listClient(query: T.ClientPageQuery) {
|
||||
return http.get<PageRes<T.ClientResp[]>>(`${BASE_URL}`, query)
|
||||
}
|
||||
|
||||
/** @desc 查询系统授权详情 */
|
||||
/** @desc 查询客户端详情 */
|
||||
export function getClient(id: string) {
|
||||
return http.get<ClientDetailResp>(`${BASE_URL}/${id}`)
|
||||
return http.get<T.ClientDetailResp>(`${BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
/** @desc 新增系统授权 */
|
||||
/** @desc 新增客户端 */
|
||||
export function addClient(data: any) {
|
||||
return http.post(`${BASE_URL}`, data)
|
||||
}
|
||||
|
||||
/** @desc 修改系统授权 */
|
||||
/** @desc 修改客户端 */
|
||||
export function updateClient(data: any, id: string) {
|
||||
return http.put(`${BASE_URL}/${id}`, data)
|
||||
}
|
||||
|
||||
/** @desc 删除系统授权 */
|
||||
export function deleteClient(id: string) {
|
||||
return http.del(`${BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
/** @desc 导出系统授权 */
|
||||
export function exportClient(query: ClientQuery) {
|
||||
return http.download(`${BASE_URL}/export`, query)
|
||||
/** @desc 删除客户端 */
|
||||
export function deleteClient(ids: string | Array<string>) {
|
||||
return http.del(`${BASE_URL}/${ids}`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user