add 新增客户端管理页面 ;
This commit is contained in:
80
src/api/system/client/index.ts
Normal file
80
src/api/system/client/index.ts
Normal file
@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ClientVO, ClientForm, ClientQuery } from '@/api/system/client/types';
|
||||
|
||||
/**
|
||||
* 查询客户端管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listClient = (query?: ClientQuery): AxiosPromise<ClientVO[]> => {
|
||||
return request({
|
||||
url: '/system/client/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询客户端管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getClient = (id: string | number): AxiosPromise<ClientVO> => {
|
||||
return request({
|
||||
url: '/system/client/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增客户端管理
|
||||
* @param data
|
||||
*/
|
||||
export const addClient = (data: ClientForm) => {
|
||||
return request({
|
||||
url: '/system/client',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改客户端管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateClient = (data: ClientForm) => {
|
||||
return request({
|
||||
url: '/system/client',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除客户端管理
|
||||
* @param id
|
||||
*/
|
||||
export const delClient = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/system/client/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 用户状态修改
|
||||
* @param userId 用户ID
|
||||
* @param status 用户状态
|
||||
*/
|
||||
export function changeStatus(id: number | string, status: string) {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
};
|
||||
return request({
|
||||
url: '/system/client/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
123
src/api/system/client/types.ts
Normal file
123
src/api/system/client/types.ts
Normal file
@ -0,0 +1,123 @@
|
||||
export interface ClientVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 客户端id
|
||||
*/
|
||||
clientId: string | number;
|
||||
|
||||
/**
|
||||
* 客户端key
|
||||
*/
|
||||
clientKey: string;
|
||||
|
||||
/**
|
||||
* 客户端秘钥
|
||||
*/
|
||||
clientSecret: string;
|
||||
|
||||
/**
|
||||
* 授权类型
|
||||
*/
|
||||
grantTypeList: string[];
|
||||
|
||||
/**
|
||||
* token活跃超时时间
|
||||
*/
|
||||
activityTimeout: number;
|
||||
|
||||
/**
|
||||
* token固定超时
|
||||
*/
|
||||
timeout: number;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ClientForm extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 客户端id
|
||||
*/
|
||||
clientId?: string | number;
|
||||
|
||||
/**
|
||||
* 客户端key
|
||||
*/
|
||||
clientKey?: string;
|
||||
|
||||
/**
|
||||
* 客户端秘钥
|
||||
*/
|
||||
clientSecret?: string;
|
||||
|
||||
/**
|
||||
* 授权类型
|
||||
*/
|
||||
grantTypeList?: string[];
|
||||
|
||||
/**
|
||||
* token活跃超时时间
|
||||
*/
|
||||
activityTimeout?: number;
|
||||
|
||||
/**
|
||||
* token固定超时
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ClientQuery extends PageQuery {
|
||||
/**
|
||||
* 客户端id
|
||||
*/
|
||||
clientId?: string | number;
|
||||
|
||||
/**
|
||||
* 客户端key
|
||||
*/
|
||||
clientKey?: string;
|
||||
|
||||
/**
|
||||
* 客户端秘钥
|
||||
*/
|
||||
clientSecret?: string;
|
||||
|
||||
/**
|
||||
* 授权类型
|
||||
*/
|
||||
grantType?: string;
|
||||
|
||||
/**
|
||||
* token活跃超时时间
|
||||
*/
|
||||
activityTimeout?: number;
|
||||
|
||||
/**
|
||||
* token固定超时
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
}
|
Reference in New Issue
Block a user