From eede51eecffed530c04591232ed06e7e8af938e6 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 21 Oct 2026 10:15:34 +0800 Subject: [PATCH] feat: about --- ui/src/api/API_README.md | 7 + ui/src/api/admin/auth/license.ts | 10 ++ ui/src/api/types/index.ts | 1 + ui/src/api/types/license.ts | 13 ++ ui/src/layout/avatar-dropdown/AboutDialog.vue | 132 ++++++++++++++++++ ui/src/layout/avatar-dropdown/index.vue | 13 +- .../node-container/NodeOperateDropdown.vue | 2 +- 7 files changed, 175 insertions(+), 3 deletions(-) create mode 100644 ui/src/api/admin/auth/license.ts create mode 100644 ui/src/api/types/license.ts create mode 100644 ui/src/layout/avatar-dropdown/AboutDialog.vue diff --git a/ui/src/api/API_README.md b/ui/src/api/API_README.md index 32573d9b978..11446e7f425 100644 --- a/ui/src/api/API_README.md +++ b/ui/src/api/API_README.md @@ -163,6 +163,13 @@ FormData;保存返回完整配置,页面以该返回值作为唯一数据来 `admin/auth/current-user.ts` 的 postCurrentUserPassword 向 `/user/current/reset_password` 提交 RSA 加密的 `{ encryptedData }`;调用方校验与加密,成功清除凭据后进入登录。 +### 平台许可证 + +`admin/system/license.ts` 通过 GET、PUT `/license/profile` 查询和更新授权信息, +更新使用 FormData 的 `license_file` 字段。`LicenseProfile` 与 `LicenseInfo` 从 `@/api/types` +导入,查询结果直接读取 `license`。关于弹窗仅商业版本查询授权,更新入口沿用系统许可证权限; +更新成功后重新查询展示,关闭弹窗时刷新页面以应用授权与权限。 + ### 四类特殊资源 API 根据资源范围或业务上下文选择出的 API 对象统一命名为 `requestApi`,包括 `computed` 结果和 diff --git a/ui/src/api/admin/auth/license.ts b/ui/src/api/admin/auth/license.ts new file mode 100644 index 00000000000..c89f01b7eb9 --- /dev/null +++ b/ui/src/api/admin/auth/license.ts @@ -0,0 +1,10 @@ +import { get, put } from '../core/request' +import type { LicenseProfile } from '@/api/types' + +/** 获取当前平台的授权信息。 */ +const getLicense = () => get('/license/profile') + +/** 上传并更新平台许可证。 */ +const putLicense = (payload: FormData) => put('/license/profile', payload) + +export default { getLicense, putLicense } diff --git a/ui/src/api/types/index.ts b/ui/src/api/types/index.ts index 42e61ebbdb9..2ad046801b5 100644 --- a/ui/src/api/types/index.ts +++ b/ui/src/api/types/index.ts @@ -6,6 +6,7 @@ export type * from './chat-auth' export type * from './chat-application' export type * from './chat-user-groups' export type * from './login' +export type * from './license' export type * from './system-user' export type * from './system-user-groups' export type * from './system-workspace' diff --git a/ui/src/api/types/license.ts b/ui/src/api/types/license.ts new file mode 100644 index 00000000000..c49dee39142 --- /dev/null +++ b/ui/src/api/types/license.ts @@ -0,0 +1,13 @@ +/** 平台许可证中用于关于弹窗展示的授权信息。 */ +export interface LicenseInfo { + corporation?: string + expired?: string + serialNo?: string + remark?: string +} + +export interface LicenseProfile { + status?: string + license?: LicenseInfo | null + message?: string +} diff --git a/ui/src/layout/avatar-dropdown/AboutDialog.vue b/ui/src/layout/avatar-dropdown/AboutDialog.vue new file mode 100644 index 00000000000..651cb1a0d4e --- /dev/null +++ b/ui/src/layout/avatar-dropdown/AboutDialog.vue @@ -0,0 +1,132 @@ + + + diff --git a/ui/src/layout/avatar-dropdown/index.vue b/ui/src/layout/avatar-dropdown/index.vue index a2cf7ef695b..fbe1e72f743 100644 --- a/ui/src/layout/avatar-dropdown/index.vue +++ b/ui/src/layout/avatar-dropdown/index.vue @@ -5,6 +5,7 @@ import LoginApi from '@/api/admin/auth/login' import { LOGIN_METHOD } from '@/api/enums' import { useStore } from '@/stores' import ChangePasswordDialog from './ChangePasswordDialog.vue' +import AboutDialog from './AboutDialog.vue' import perm from '@/permission/index.ts' defineOptions({ name: 'AvatarDropdown' }) @@ -27,6 +28,13 @@ function handleOpenChangePassword() { changePasswordDialogRef.value?.open() } +// 查看平台版本与授权信息。 +const aboutDialogRef = ref>() + +function handleOpenAbout() { + aboutDialogRef.value?.open() +} + function handleLogout() { const loginMode = user.userInfo?.source LoginApi.postLogout().then(() => { @@ -113,8 +121,8 @@ function toUrl(url?: string) { 论坛求助 - - + + 关于 @@ -127,4 +135,5 @@ function toUrl(url?: string) { + diff --git a/ui/src/workflow-canvas/core/node-container/NodeOperateDropdown.vue b/ui/src/workflow-canvas/core/node-container/NodeOperateDropdown.vue index 07b7c5ec7ef..a8c0e107cef 100644 --- a/ui/src/workflow-canvas/core/node-container/NodeOperateDropdown.vue +++ b/ui/src/workflow-canvas/core/node-container/NodeOperateDropdown.vue @@ -144,7 +144,7 @@ function deleteNode() { 删除
-
来源
+
来源
{{ sourceName }}