提交 ac6234fc 作者: 方治民

feat(api): 优化 API 相关配置

上级 62a19309
# API 接口地址
VITE_GLOB_API_URL=http://192.168.0.156:17181
VITE_GLOB_API_URL=http://192.168.0.156:8081
# API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/api
{
"originType": "SwaggerV3",
"originUrl": "http://127.0.0.1:8081/api/v3/api-docs",
"originUrl": "http://192.168.0.156:8081/api/v3/api-docs",
"templateType": "fetch",
"templatePath": "./pont-template",
"transformPath": "./pont-transform",
......
......@@ -35,8 +35,9 @@ export default class BasicGenerator extends CodeGenerator {
}
if (requestParams.includes('body')) {
requestParams = requestParams.replace('params?: Params, ', '')
bodyTypeDef = requestParams.replace(/^.*body: (.*),.*$/gi, '$1')
requestParams = requestParams.replace('params?: Params, ', '')
requestParams = requestParams.replace('body:', 'body?:')
}
}
......@@ -51,11 +52,18 @@ export default class BasicGenerator extends CodeGenerator {
getInterfaceContentInDeclaration(inter: Interface) {
const paramsCode = inter.getParamsCode('Params')
const requestParams = this.getParams(inter, paramsCode)
const sourceResponseType = inter.responseType
const targetResponseType =
sourceResponseType === 'File'
? 'void'
: sourceResponseType === 'defs.ResultString'
? 'string'
: sourceResponseType.replace(/defs.Result(.*)/, 'defs.$1')
return `
export ${paramsCode}
export type Response = ${inter.responseType.replace(/defs.Result\<(.*)\>/, '$1')};
export type Response = ${targetResponseType};
export const init: Response;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,6 +3,54 @@ type ObjectMap<Key extends string | number | symbol = any, Value = any> = {
}
declare namespace defs {
export class DictItemVo {
/** 字典选项描述 */
description?: string
/** 字典选项是否启用 */
enable?: boolean
/** id */
id?: string
/** 字典选项名称 */
name?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项值 */
value?: string
}
export class DictVo {
/** 字典编号 */
code?: string
/** 字典描述 */
description?: string
/** id */
id?: string
/** 字典名称 */
name?: string
}
export class KeyValueVo {
/** 是否启用 */
enable?: string
/** key */
key?: string
/** label */
label?: string
/** value */
value?: string
}
export class LoginVo {
/** token */
token?: string
......@@ -48,6 +96,28 @@ declare namespace defs {
sortOrder?: 'ASC' | 'DESC'
}
export class PageVoDictItemVo {
/** 数据 */
data?: Array<defs.DictItemVo>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PageVoDictVo {
/** 数据 */
data?: Array<defs.DictVo>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PageVoPermissionVo {
/** 数据 */
data?: Array<defs.PermissionVo>
......@@ -92,6 +162,47 @@ declare namespace defs {
total?: number
}
export class PermissionParam {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id?: string
/** 元数据 */
meta?: ObjectMap<any, object>
/** 名称 */
name?: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type?: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid?: string
}
export class PermissionVo {
/** children */
children?: Array<defs.PermissionVo>
......@@ -133,6 +244,32 @@ declare namespace defs {
uid?: string
}
export class ResultArrayListKeyValueVo {
/** 内容 */
body?: Array<defs.KeyValueVo>
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultArrayListMenuVo {
/** 内容 */
body?: Array<defs.MenuVo>
......@@ -263,6 +400,58 @@ declare namespace defs {
timestamp?: string
}
export class ResultDictItemVo {
/** body */
body?: defs.DictItemVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultDictVo {
/** body */
body?: defs.DictVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultLoginVo {
/** body */
body?: defs.LoginVo
......@@ -289,6 +478,58 @@ declare namespace defs {
timestamp?: string
}
export class ResultPageVoDictItemVo {
/** body */
body?: defs.PageVoDictItemVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultPageVoDictVo {
/** body */
body?: defs.PageVoDictVo
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class ResultPageVoPermissionVo {
/** body */
body?: defs.PageVoPermissionVo
......@@ -630,7 +871,7 @@ declare namespace API {
password: string
}
export type Response = defs.ResultLoginVo
export type Response = defs.LoginVo
export const init: Response
......@@ -648,7 +889,7 @@ declare namespace API {
export namespace logout {
export class Params {}
export type Response = defs.ResultString
export type Response = string
export const init: Response
......@@ -677,13 +918,11 @@ declare namespace API {
avatar?: string
/** 邮箱 */
email?: string
/** 简介 */
introduction?: string
/** 是否启用 */
enable?: boolean
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
......@@ -704,7 +943,7 @@ declare namespace API {
password: string
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
......@@ -722,7 +961,7 @@ declare namespace API {
export namespace valid {
export class Params {}
export type Response = defs.ResultBoolean
export type Response = defs.Boolean
export const init: Response
......@@ -735,71 +974,382 @@ declare namespace API {
}
/**
* 示例
* 字典管理
*/
export namespace example {
export namespace dict {
/**
* Hello World
* /example/
* 新增
* /sys/dict/add
*/
export namespace hello {
export class Params {}
export namespace add {
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
export function request(
params?: Params,
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 文件下载
* /example/download
* 查询
* /sys/dict/find
*/
export namespace download {
export class Params {}
export namespace find {
export class Params {
/** id */
id: string
}
export type Response = string
export type Response = defs.DictVo
export const init: Response
export function request(
params?: Params,
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 测试失败
* /example/fail
* 修改
* /sys/dict/modify
*/
export namespace fail {
export class Params {}
export namespace modify {
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
export function request(
params?: Params,
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 查询用户属性
* /example/findUserExtensionInfo
* 分页查询
* /sys/dict/page
*/
export namespace findUserExtensionInfo {
export namespace page {
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export type Response = defs.PageVoDictVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /sys/dict/remove
*/
export namespace remove {
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 选项查询
* /sys/dict/selector
*/
export namespace selector {
export class Params {}
export type Response = defs.ResultUserExtensionVo
export type Response = defs.ArrayListKeyValueVo
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
* 字典选项管理
*/
export namespace dictItem {
/**
* 新增
* /sys/dict/item/add
*/
export namespace add {
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 查询
* /sys/dict/item/find
*/
export namespace find {
export class Params {
/** id */
id: string
}
export type Response = defs.DictItemVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 修改
* /sys/dict/item/modify
*/
export namespace modify {
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分页查询
* /sys/dict/item/page
*/
export namespace page {
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export type Response = defs.PageVoDictItemVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /sys/dict/item/remove
*/
export namespace remove {
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 选项查询
* /sys/dict/item/selector
*/
export namespace selector {
export class Params {
/** 字典 ID */
dictId?: string
/** 字典 ID */
dictCode?: string
/** 字典选项是否启用 */
enable?: boolean
}
export type Response = defs.ArrayListKeyValueVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
* 示例
*/
export namespace example {
/**
* Hello World
* /example/
*/
export namespace hello {
export class Params {}
export type Response = string
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 文件下载
* /example/download
*/
export namespace download {
export class Params {}
export type Response = void
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 测试失败
* /example/fail
*/
export namespace fail {
export class Params {}
export type Response = string
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 查询用户属性
* /example/findUserExtensionInfo
*/
export namespace findUserExtensionInfo {
export class Params {}
export type Response = defs.UserExtensionVo
export const init: Response
......@@ -817,12 +1367,12 @@ declare namespace API {
export namespace json {
export class Params {}
export type Response = defs.ResultPageVoString
export type Response = defs.PageVoString
export const init: Response
export function request(
body: defs.PageParam,
body?: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions,
): Promise<Response>
......@@ -834,9 +1384,9 @@ declare namespace API {
*/
export namespace page {
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......@@ -844,7 +1394,7 @@ declare namespace API {
sortOrder?: string
}
export type Response = defs.ResultPageVoString
export type Response = defs.PageVoString
export const init: Response
......@@ -854,6 +1404,24 @@ declare namespace API {
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 文件上传
* /example/upload
*/
export namespace upload {
export class Params {}
export type Response = string
export const init: Response
export function request(
body?: object,
config?: http.RequestConfig<object>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
......@@ -872,7 +1440,7 @@ declare namespace API {
object: string
}
export type Response = string
export type Response = void
export const init: Response
......@@ -890,12 +1458,12 @@ declare namespace API {
export namespace upload {
export class Params {}
export type Response = defs.ResultString
export type Response = string
export const init: Response
export function request(
body: object,
body?: object,
config?: http.RequestConfig<object>,
options?: http.RequestOptions,
): Promise<Response>
......@@ -908,12 +1476,12 @@ declare namespace API {
export namespace uploadBase64Image {
export class Params {}
export type Response = defs.ResultString
export type Response = string
export const init: Response
export function request(
body: string,
body?: string,
config?: http.RequestConfig<string>,
options?: http.RequestOptions,
): Promise<Response>
......@@ -929,63 +1497,15 @@ declare namespace API {
* /sys/permission/add
*/
export namespace add {
export class Params {
/** id */
id: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 重定向 */
redirect?: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export type Response = defs.ResultString
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /sys/permission/deleted
*/
export namespace deleted {
export class Params {
/** id */
id: string
}
export class Params {}
export type Response = defs.ResultString
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
): Promise<Response>
}
......@@ -1000,7 +1520,7 @@ declare namespace API {
id: string
}
export type Response = defs.ResultPermissionVo
export type Response = defs.PermissionVo
export const init: Response
......@@ -1016,42 +1536,15 @@ declare namespace API {
* /sys/permission/modify
*/
export namespace modify {
export class Params {
/** id */
id: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 重定向 */
redirect?: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export class Params {}
export type Response = defs.ResultString
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
): Promise<Response>
}
......@@ -1062,9 +1555,9 @@ declare namespace API {
*/
export namespace page {
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......@@ -1072,7 +1565,28 @@ declare namespace API {
sortOrder?: string
}
export type Response = defs.ResultPageVoPermissionVo
export type Response = defs.PageVoPermissionVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /sys/permission/remove
*/
export namespace remove {
export class Params {
/** id */
id: string
}
export type Response = string
export const init: Response
......@@ -1093,7 +1607,7 @@ declare namespace API {
pid: string
}
export type Response = defs.ResultArrayListPermissionVo
export type Response = defs.ArrayListPermissionVo
export const init: Response
......@@ -1123,7 +1637,7 @@ declare namespace API {
name: string
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
......@@ -1146,28 +1660,7 @@ declare namespace API {
ids: string
}
export type Response = defs.ResultString
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /sys/role/deleted
*/
export namespace deleted {
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
......@@ -1188,7 +1681,7 @@ declare namespace API {
id: string
}
export type Response = defs.ResultRoleVo
export type Response = defs.RoleVo
export const init: Response
......@@ -1213,7 +1706,7 @@ declare namespace API {
name: string
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
......@@ -1230,9 +1723,9 @@ declare namespace API {
*/
export namespace page {
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......@@ -1240,7 +1733,28 @@ declare namespace API {
sortOrder?: string
}
export type Response = defs.ResultPageVoRoleVo
export type Response = defs.PageVoRoleVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /sys/role/remove
*/
export namespace remove {
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string
export const init: Response
......@@ -1258,7 +1772,7 @@ declare namespace API {
export namespace selector {
export class Params {}
export type Response = defs.ResultArrayListRoleVo
export type Response = defs.ArrayListRoleVo
export const init: Response
......@@ -1286,7 +1800,7 @@ declare namespace API {
ids: string
}
export type Response = defs.ResultString
export type Response = string
export const init: Response
......@@ -1303,9 +1817,9 @@ declare namespace API {
*/
export namespace page {
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......@@ -1313,7 +1827,7 @@ declare namespace API {
sortOrder?: string
}
export type Response = defs.ResultPageVoUserVo
export type Response = defs.PageVoUserVo
export const init: Response
......@@ -1336,7 +1850,7 @@ declare namespace API {
export namespace getMenuList {
export class Params {}
export type Response = defs.ResultArrayListMenuVo
export type Response = defs.ArrayListMenuVo
export const init: Response
......@@ -1354,7 +1868,7 @@ declare namespace API {
export namespace getPermCode {
export class Params {}
export type Response = defs.ResultArrayListString
export type Response = defs.ArrayListString
export const init: Response
......@@ -1372,7 +1886,7 @@ declare namespace API {
export namespace getUserInfo {
export class Params {}
export type Response = defs.ResultUserInfo
export type Response = defs.UserInfo
export const init: Response
......
export class DictItemVo {
/** 字典选项描述 */
description = ''
/** 字典选项是否启用 */
enable = false
/** id */
id = ''
/** 字典选项名称 */
name = ''
/** 字典选项排序序号 */
serial = undefined
/** 字典选项值 */
value = ''
}
export class DictVo {
/** 字典编号 */
code = ''
/** 字典描述 */
description = ''
/** id */
id = ''
/** 字典名称 */
name = ''
}
export class KeyValueVo {
/** 是否启用 */
enable = ''
/** key */
key = ''
/** label */
label = ''
/** value */
value = ''
}
export class LoginVo {
/** token */
token = ''
......@@ -43,6 +91,28 @@ export class PageParam {
sortOrder = 'ASC'
}
export class PageVoDictItemVo {
/** 数据 */
data = []
/** 数据最新时间 */
latest = ''
/** 数据总数 */
total = undefined
}
export class PageVoDictVo {
/** 数据 */
data = []
/** 数据最新时间 */
latest = ''
/** 数据总数 */
total = undefined
}
export class PageVoPermissionVo {
/** 数据 */
data = []
......@@ -87,6 +157,47 @@ export class PageVoUserVo {
total = undefined
}
export class PermissionParam {
/** 组件 */
component = ''
/** 是否启用 */
enable = false
/** 是否隐藏 */
hidden = false
/** 图标 */
icon = ''
/** id */
id = ''
/** 元数据 */
meta = undefined
/** 名称 */
name = ''
/** 路径 */
path = ''
/** 父级ID */
pid = ''
/** 重定向 */
redirect = ''
/** 序号 */
serial = undefined
/** 权限类型 */
type = 'DIR'
/** 标识 */
uid = ''
}
export class PermissionVo {
/** children */
children = []
......@@ -128,6 +239,32 @@ export class PermissionVo {
uid = ''
}
export class ResultArrayListKeyValueVo {
/** 内容 */
body = []
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultArrayListMenuVo {
/** 内容 */
body = []
......@@ -258,6 +395,58 @@ export class ResultBoolean {
timestamp = ''
}
export class ResultDictItemVo {
/** body */
body = new DictItemVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultDictVo {
/** body */
body = new DictVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultLoginVo {
/** body */
body = new LoginVo()
......@@ -284,6 +473,58 @@ export class ResultLoginVo {
timestamp = ''
}
export class ResultPageVoDictItemVo {
/** body */
body = new PageVoDictItemVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultPageVoDictVo {
/** body */
body = new PageVoDictVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class ResultPageVoPermissionVo {
/** body */
body = new PageVoPermissionVo()
......
......@@ -18,8 +18,6 @@ export class Params {
avatar?: string
/** 邮箱 */
email?: string
/** 简介 */
introduction?: string
/** 是否启用 */
enable?: boolean
}
......
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
}
export const init = new defs.ResultDictVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description 字典管理
*/
import * as add from './add'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, find, modify, page, remove, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export const init = new defs.ResultPageVoDictVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/page',
method: 'GET',
params,
...config,
},
options,
)
}
......@@ -15,7 +15,7 @@ export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/role/deleted',
url: '/sys/dict/remove',
method: 'POST',
data: params,
......
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.ResultArrayListKeyValueVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/selector',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
}
export const init = new defs.ResultDictItemVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description 字典选项管理
*/
import * as add from './add'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, find, modify, page, remove, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export const init = new defs.ResultPageVoDictItemVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/page',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/remove',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 字典 ID */
dictId?: string
/** 字典 ID */
dictCode?: string
/** 字典选项是否启用 */
enable?: boolean
}
export const init = new defs.ResultArrayListKeyValueVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/selector',
method: 'GET',
params,
...config,
},
options,
)
}
......@@ -7,5 +7,6 @@ import * as fail from './fail'
import * as findUserExtensionInfo from './findUserExtensionInfo'
import * as json from './json'
import * as page from './page'
import * as upload from './upload'
export { hello, download, fail, findUserExtensionInfo, json, page }
export { hello, download, fail, findUserExtensionInfo, json, page, upload }
......@@ -8,7 +8,7 @@ import { defHttp } from '/@/utils/http/axios'
export const init = new defs.ResultPageVoString()
export function request(
body: defs.PageParam,
body?: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions,
) {
......
......@@ -6,9 +6,9 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......
/**
* @desc 文件上传
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export const init = new defs.ResultString()
export function request(body?: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/example/upload',
method: 'POST',
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
options,
)
}
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export const init = new defs.ResultString()
export function request(body: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
export function request(body?: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/upload',
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export const init = new defs.ResultString()
export function request(body: string, config?: http.RequestConfig<string>, options?: http.RequestOptions) {
export function request(body?: string, config?: http.RequestConfig<string>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/uploadBase64Image',
......
import * as auth from './auth'
import * as dict from './dict'
import * as dictItem from './dictItem'
import * as example from './example'
import * as file from './file'
import * as permission from './permission'
......@@ -8,6 +10,8 @@ import * as userView from './userView'
export const API = {
auth,
dict,
dictItem,
example,
file,
permission,
......
......@@ -5,43 +5,19 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 重定向 */
redirect?: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
export function request(
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
) {
return defHttp.request(
{
url: '/sys/permission/add',
method: 'POST',
data: params,
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
......@@ -2,10 +2,10 @@
* @description 权限管理
*/
import * as add from './add'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as tree from './tree'
export { add, deleted, find, modify, page, tree }
export { add, find, modify, page, remove, tree }
......@@ -5,43 +5,19 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 序号 */
serial?: number
/** 标识 */
uid: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 重定向 */
redirect?: string
/** 组件 */
component?: string
/** 图标 */
icon?: string
/** 是否隐藏 */
hidden?: boolean
/** 是否启用 */
enable?: boolean
/** 父级ID */
pid?: string
/** 元数据 */
meta?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
export function request(
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
) {
return defHttp.request(
{
url: '/sys/permission/modify',
method: 'POST',
data: params,
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
......@@ -6,9 +6,9 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......
......@@ -15,7 +15,7 @@ export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/permission/deleted',
url: '/sys/permission/remove',
method: 'POST',
data: params,
......
......@@ -3,10 +3,10 @@
*/
import * as add from './add'
import * as assign from './assign'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, assign, deleted, find, modify, page, selector }
export { add, assign, find, modify, page, remove, selector }
......@@ -6,9 +6,9 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/role/remove',
method: 'POST',
data: params,
...config,
},
options,
)
}
......@@ -6,9 +6,9 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** pageSize */
/** 分页条数 */
pageSize: number
/** pageNo */
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
......
import { useGlobSetting } from '/@/hooks/setting'
const globSetting = useGlobSetting()
let HOST = globSetting.apiUrl
let HOST = 'localhost'
let API_URL = `${HOST}`
let API_URL_PREFIX = globSetting.urlPrefix
......@@ -9,6 +9,7 @@ let API_URL_PREFIX = globSetting.urlPrefix
// ✨ 生产环境
// HOST = 'https://beta.app.yiring.com'
// API_URL = `${HOST}`
// API_URL_PREFIX = globSetting.urlPrefix
// 📖 开发环境
HOST = globSetting.apiUrl
......@@ -16,7 +17,10 @@ API_URL = `${HOST}`
API_URL_PREFIX = globSetting.urlPrefix
// 🔦 检查生产环境,使用对应 env 中的配置,保留原有方式方便开发中调试
API_URL = import.meta.env.MODE !== 'development' ? globSetting.apiUrl : API_URL
if (import.meta.env.MODE !== 'development') {
API_URL = globSetting.apiUrl
API_URL_PREFIX = globSetting.urlPrefix
}
// 📢 如果使用代理访问网站,则默认使用代理 API 地址
// API_URL = isProxy(window.location.host) ? `http://proxy.yiring.com` : API_URL
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论