优化

pull/37/head
smallbun 2023-08-28 21:20:56 +08:00
parent 29f54ece54
commit 5893369709
2 changed files with 54 additions and 7 deletions

View File

@ -18,7 +18,6 @@
import { download, filterParamConverter, sortParamConverter } from '@/utils/utils';
import type { RequestData } from '@ant-design/pro-components';
import type { SortOrder } from 'antd/es/table/interface';
import type { ReactText } from 'react';
import { request } from '@umijs/max';
import type { UploadFile } from 'antd/es/upload/interface';
@ -28,7 +27,7 @@ import type { UploadFile } from 'antd/es/upload/interface';
export async function getAppTemplateList(
params: Record<string, any>,
sort: Record<string, SortOrder>,
filter: Record<string, ReactText[] | null>,
filter: Record<string, string[] | null>,
): Promise<RequestData<AppAPI.ListTemplate>> {
return request<API.ApiResult<AppAPI.ListTemplate>>('/api/v1/app/template/list', {
params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) },
@ -59,7 +58,7 @@ export async function getAppTemplateFormSchema(
export async function getAppList(
params?: Record<string, any>,
sort?: Record<string, SortOrder>,
filter?: Record<string, ReactText[] | null>,
filter?: Record<string, string[] | null>,
): Promise<RequestData<AppAPI.AppList>> {
return request<API.ApiResult<AppAPI.AppList>>('/api/v1/app/list', {
params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) },
@ -190,7 +189,7 @@ export async function getCertList(
export async function getAppAccountList(
params: Record<string, any>,
sort: Record<string, SortOrder>,
filter: Record<string, ReactText[] | null>,
filter: Record<string, string[] | null>,
): Promise<RequestData<AppAPI.AppAccountList>> {
return request<API.ApiResult<AppAPI.AppAccountList>>('/api/v1/app/account/list', {
params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) },
@ -232,7 +231,7 @@ export async function removeAccount(id: string): Promise<API.ApiResult<boolean>>
export async function getAppAccessPolicyList(
params: Record<string, any>,
sort: Record<string, SortOrder>,
filter: Record<string, ReactText[] | null>,
filter: Record<string, string[] | null>,
): Promise<RequestData<AppAPI.AppAccessPolicyList>> {
return request<API.ApiResult<AppAPI.AppAccessPolicyList>>('/api/v1/app/access_policy/list', {
params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) },

View File

@ -373,7 +373,6 @@ declare namespace AccountAPI {
};
}
/**
* API
*
@ -381,7 +380,6 @@ declare namespace AccountAPI {
* Created by support@topiam.cn on 2020/9/13 11:26
*/
declare namespace AppAPI {
/**
*
*/
@ -410,4 +408,54 @@ declare namespace AppAPI {
//Effect
effect: string;
};
/**
*
*/
export type AppList = {
id: string;
name: string;
icon?: string;
protocol: string;
enabled: boolean;
type: string;
template: string;
remark: string;
};
/**
*
*/
export type ListTemplate = {
protocol: string;
type: string;
code: string;
icon: string;
name: string;
desc: string;
};
/**
*
*/
export type GetApp = {
id: string;
type: string;
name: string;
icon: string;
template: string;
protocol: string;
protocolName: string;
clientId: string;
clientSecret: string;
//sso发起方
initLoginType: string;
//sso登录链接
initLoginUrl: string;
nameIdValueType: string;
//授权范围
authorizationType: string;
enabled: boolean;
remark: string;
};
}