diff --git a/package.json b/package.json index ec0cbed6..8ee9ec81 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue3-element-admin", "description": "Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板,vue-element-admin 的 Vue3 版本", - "version": "4.7.5", + "version": "4.7.6", "private": true, "type": "module", "scripts": { diff --git a/src/api/system/app/index.ts b/src/api/system/app/index.ts new file mode 100644 index 00000000..cb93eae4 --- /dev/null +++ b/src/api/system/app/index.ts @@ -0,0 +1,44 @@ +import request from "@/utils/request"; +import type { AppQueryParams, AppForm, AppItem } from "./types"; +import type { PageResult } from "@/api/common"; + +const APP_BASE_URL = "/api/v1/apps"; + +const AppAPI = { + /** 获取应用分页数据 */ + getPage(queryParams?: AppQueryParams) { + return request>({ + url: `${APP_BASE_URL}`, + method: "get", + params: queryParams, + }); + }, + /** 获取应用表单数据 */ + getFormData(id: string) { + return request({ + url: `${APP_BASE_URL}/${id}/form`, + method: "get", + }); + }, + /** 新增应用 */ + create(data: AppForm) { + return request({ url: `${APP_BASE_URL}`, method: "post", data }); + }, + /** 修改应用 */ + update(id: string, data: AppForm) { + return request({ url: `${APP_BASE_URL}/${id}`, method: "put", data }); + }, + /** 删除应用(多个 ID 以英文逗号分隔) */ + deleteByIds(ids: string) { + return request({ url: `${APP_BASE_URL}/${ids}`, method: "delete" }); + }, + /** 修改应用状态 */ + updateStatus(id: string, status: number) { + return request({ url: `${APP_BASE_URL}/${id}/status`, method: "put", data: { status } }); + }, +}; + +export default AppAPI; + +// 重导出类型 +export * from "./types"; diff --git a/src/api/system/app/types.ts b/src/api/system/app/types.ts new file mode 100644 index 00000000..a8feb84a --- /dev/null +++ b/src/api/system/app/types.ts @@ -0,0 +1,54 @@ +/** + * 应用管理类型定义 + */ + +import type { BaseQueryParams } from "@/api/common"; + +/** 三方平台(微信公众平台 / 微信小程序 / 支付宝 / 苹果 / QQ) */ +export type AppPlatform = "WECHAT_MP" | "WECHAT_MINI" | "ALIPAY" | "APPLE" | "QQ"; + +/** 应用分页查询参数 */ +export interface AppQueryParams extends BaseQueryParams { + /** 关键字(应用名称 / 应用编码 / AppId) */ + keywords?: string; + /** 状态(1-正常 0-禁用) */ + status?: number; + /** 平台 */ + platform?: string; +} + +/** 应用表单对象 */ +export interface AppForm { + /** 应用 ID */ + id?: string; + /** 应用名称 */ + appName: string; + /** 应用编码 */ + appCode: string; + /** 平台(WECHAT_MP / WECHAT_MINI / ALIPAY / APPLE / QQ) */ + platform: string; + /** 微信 / 平台 AppId */ + appId: string; + /** AppSecret */ + appSecret?: string; + /** 商户号 */ + merchantId?: string; + /** 商户密钥 */ + merchantKey?: string; + /** 状态(1-正常 0-禁用) */ + status?: number; + /** 备注 */ + remark?: string; + /** 租户 ID(平台级配置,默认 0) */ + tenantId?: string; +} + +/** 应用分页对象 */ +export interface AppItem extends AppForm { + id?: string; + createBy?: string; + createTime?: string; + updateBy?: string; + updateTime?: string; + isDeleted?: number; +} diff --git a/src/views/system/app/index.vue b/src/views/system/app/index.vue new file mode 100644 index 00000000..7a5b213e --- /dev/null +++ b/src/views/system/app/index.vue @@ -0,0 +1,403 @@ + + +