From cbc29cf255b4db71ac3849f7bb9499db3cf7d5ca Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Thu, 11 Jun 2026 12:25:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(update):=20=E6=B7=BB=E5=8A=A0=20API=20Key?= =?UTF-8?q?=20=E7=AE=A1=E7=90=86=E5=92=8C=20WebSocket=20=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 API Key 管理功能,支持外部工具认证调用平台 API - 实现 WebSocket 实时通知,版本发布时推送轻量通知给客户端 - 添加 APK 文件哈希校验,支持已下载检测和直接安装 - 支持外部 APK 上传使用 API Key 认证 - 优化私有化部署自动注入 nginx WebSocket 代理配置 - 扩展 SDK 功能包括已下载检测、直接安装和实时通知监听 --- .../src/views/update/StoreGuideView.vue | 194 ++++++++++-------- .../views/update/VersionManagementView.vue | 125 ++++++----- 2 files changed, 189 insertions(+), 130 deletions(-) diff --git a/tenant-platform/src/views/update/StoreGuideView.vue b/tenant-platform/src/views/update/StoreGuideView.vue index cc4e119..0881427 100644 --- a/tenant-platform/src/views/update/StoreGuideView.vue +++ b/tenant-platform/src/views/update/StoreGuideView.vue @@ -3,7 +3,7 @@
-
- {{ store.label }} - 已接入 +
+
{{ group.label }}
+
+ {{ store.label }} +
@@ -30,17 +32,12 @@
{{ activeStore.label }} - 已接入

{{ activeStore.subtitle }}

- - {{ activeStore.urlLabel }} -
- -
+
{{ activeStore.hint }}

-
+ +
@@ -83,39 +85,36 @@ interface StoreGuide { steps: { title: string; description: string }[] hint: string image?: string - enabled: boolean } const STORE_GUIDES: StoreGuide[] = [ { type: 'HUAWEI', label: '华为应用市场', - subtitle: 'AppGallery Connect Connect API 凭据', + subtitle: 'AppGallery Connect API 凭据', url: 'https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114', urlLabel: '查看华为官方文档', steps: [ - { title: '创建应用', description: '在 AppGallery Connect 中打开目标应用。' }, - { title: '创建 Connect API 凭据', description: '保存 Client ID 和 Client Secret。' }, - { title: '回到版本管理页保存', description: '配置凭据后即可提交审核。' }, + { title: '进入 AppGallery Connect', description: '在华为开发者平台找到目标应用。' }, + { title: '创建 Connect API 凭据', description: '进入开发工具 → Connect API,创建服务端凭据并选择 APP 管理员角色。' }, + { title: '填写 Client ID / Client Secret', description: '复制凭据信息保存到租户平台的凭据配置中。' }, ], - hint: '适合上传 APK 并提交审核;支持回调跟踪审核状态。', + hint: '配置后可自动上传 APK 并提交审核,支持回调跟踪审核状态。', image: huaweiGuideImage, - enabled: true, }, { type: 'MI', label: '小米应用商店', - subtitle: '使用自动发布接口的账号与私钥', + subtitle: '自动发布接口的账号与私钥', url: 'https://dev.mi.com/distribute/doc/details?pId=1134', urlLabel: '查看小米官方文档', steps: [ - { title: '进入应用管理', description: '定位到目标应用。' }, - { title: '准备自动发布接口密钥', description: '记录用户名、公钥证书和 RSA 私钥。' }, - { title: '保存到租户平台', description: '完成后可提交审核。' }, + { title: '进入应用游戏管理', description: '在控制台选择目标应用。' }, + { title: '打开自动发布接口', description: '下载公钥文件并准备 RSA 私钥。' }, + { title: '填写用户名 / 公钥 / 私钥', description: '保存的是服务端上传所需凭据。' }, ], - hint: '字段按 username / publicKey / privateKey 保存。', + hint: '字段为 username / publicKey / privateKey,与后端服务一致。', image: miGuideImage, - enabled: true, }, { type: 'OPPO', @@ -124,13 +123,12 @@ const STORE_GUIDES: StoreGuide[] = [ url: 'https://open.oppomobile.com/new/developmentDoc/info?id=11119', urlLabel: '查看 OPPO 官方文档', steps: [ - { title: '进入我的 API', description: '确认当前应用可创建服务端应用。' }, - { title: '创建 client_id / client_secret', description: '完成服务端凭据申请。' }, - { title: '保存并提交审核', description: '配置完成后返回版本管理页。' }, + { title: '进入"我的 API"', description: '确认当前应用拥有服务端应用能力。' }, + { title: '新建服务端应用', description: '按平台要求创建接口凭据。' }, + { title: '填写 Client ID / Client Secret', description: '对应凭据配置中的两个字段。' }, ], - hint: '与后端 submitToOppo 的字段一致。', + hint: '字段与后端 submitToOppo 读取逻辑一致。', image: oppoGuideImage, - enabled: true, }, { type: 'VIVO', @@ -139,13 +137,12 @@ const STORE_GUIDES: StoreGuide[] = [ url: 'https://dev.vivo.com.cn/documentCenter/doc/326', urlLabel: '查看 vivo 官方文档', steps: [ - { title: '进入 API 管理', description: '找到当前应用对应入口。' }, - { title: '复制 access key 和 secret', description: '按服务端要求保存。' }, - { title: '保存后提交审核', description: '审核状态会通过 Webhook 回传。' }, + { title: '进入 API 管理', description: '找到当前应用对应的接口管理入口。' }, + { title: '激活后再读取密钥', description: '首次启用后可能需要刷新页面。' }, + { title: '填写 Access Key / Access Secret', description: '与后端提交服务字段保持一致。' }, ], hint: '注意请求频率限制,状态拉取需做节流。', image: vivoGuideImage, - enabled: true, }, { type: 'HONOR', @@ -154,27 +151,12 @@ const STORE_GUIDES: StoreGuide[] = [ url: 'https://developer.honor.com/cn', urlLabel: '查看荣耀官方文档', steps: [ - { title: '进入管理中心', description: '打开荣耀开发者后台。' }, - { title: '申请服务端凭据', description: '保存 Client ID / Client Secret。' }, - { title: '提交审核', description: '与华为同类流程接入。' }, + { title: '进入管理中心', description: '打开荣耀开发者后台并进入凭证页。' }, + { title: '申请凭证', description: '创建用于服务端上传的 API 凭据。' }, + { title: '填写 Client ID / Client Secret', description: '与华为同类流程接入。' }, ], - hint: 'Harmony 这条线仅跳转应用市场,不提供本地安装包。', + hint: '与后端 Honor 提交流程完全一致。', image: honorGuideImage, - enabled: true, - }, - { - type: 'HARMONY_APP', - label: '鸿蒙应用', - subtitle: '鸿蒙应用市场独立跳转页', - url: 'https://developer.huawei.com/consumer/cn/', - urlLabel: '查看鸿蒙官方文档', - steps: [ - { title: '确认鸿蒙应用页', description: '准备独立的鸿蒙应用市场详情页。' }, - { title: '复制跳转链接', description: '如需市场跳转,再把详情页链接填写到应用商店配置。' }, - { title: '回到版本管理页', description: '鸿蒙版本仅记录版本号和跳转页,不填也可继续。' }, - ], - hint: '鸿蒙应用配置只维护市场跳转页,不参与 Android 审核上传。', - enabled: true, }, { type: 'APP_STORE', @@ -183,12 +165,24 @@ const STORE_GUIDES: StoreGuide[] = [ url: 'https://developer.apple.com/documentation/appstoreconnectapi', urlLabel: '查看 Apple 官方文档', steps: [ - { title: '创建 API Key', description: '保存 Team ID / Key ID / p8 私钥。' }, - { title: '补充 Bundle ID', description: '回到版本管理页保存包名;链接可选。' }, - { title: '提交审核', description: '支持审核后自动发布,链接不填也能继续走流程。' }, + { title: '创建 API Key', description: '进入 App Store Connect → 用户和访问 → 整合 → 点击 "+" 创建密钥。' }, + { title: '下载 .p8 私钥', description: '创建后立即下载私钥文件(只能下载一次),复制完整内容。' }, + { title: '填写 Issuer ID / Key ID / 私钥', description: 'Issuer ID 在整合页面顶部,Key ID 在密钥列表中。' }, ], - hint: 'iOS 的 App Store 链接可选填写,需要跳转时再补。', - enabled: true, + hint: '配置 API Key 后可自动查询审核状态。私钥为 .p8 文件的完整内容,包含 BEGIN/END 标记。', + }, + { + type: 'HARMONY_APP', + label: '鸿蒙应用', + subtitle: 'AppGallery Connect API 凭据', + url: 'https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agcapi-getstarted-0000001111845114', + urlLabel: '查看鸿蒙官方文档', + steps: [ + { title: '进入 AppGallery Connect', description: '在华为开发者平台找到目标鸿蒙应用。' }, + { title: '创建 Connect API 凭据', description: '进入开发工具 → Connect API,创建服务端凭据。' }, + { title: '填写 Client ID / Client Secret', description: '复制凭据信息保存到凭据配置中。' }, + ], + hint: '配置 API 凭证后可自动查询审核状态。鸿蒙应用审核流程与华为应用市场共用 AppGallery Connect 平台。', }, { type: 'GOOGLE_PLAY', @@ -197,20 +191,30 @@ const STORE_GUIDES: StoreGuide[] = [ url: 'https://developer.android.com/google/play/developer-api', urlLabel: '查看 Google Play 官方文档', steps: [ - { title: '创建服务账号', description: '从 Google Cloud 获取 JSON。' }, - { title: '绑定 Play 权限', description: '授予对应应用的发布权限。' }, - { title: '保存服务账号 JSON', description: '回到版本管理页保存凭据。' }, + { title: '创建服务账号', description: '从 Google Cloud 控制台获取服务账号 JSON。' }, + { title: '授予 Play 管理权限', description: '把该服务账号绑定到目标应用的发布权限。' }, + { title: '粘贴 JSON 内容', description: '将完整的 JSON 内容保存到凭据配置中。' }, ], hint: '适合由服务端或脚本自动提交审核。', - enabled: true, }, ] +const GUIDE_GROUPS = [ + { label: 'Android', stores: STORE_GUIDES.filter(s => ['HUAWEI', 'MI', 'OPPO', 'VIVO', 'HONOR', 'GOOGLE_PLAY'].includes(s.type)) }, + { label: 'iOS / 鸿蒙', stores: STORE_GUIDES.filter(s => ['APP_STORE', 'HARMONY_APP'].includes(s.type)) }, +] + const activeStoreType = ref(STORE_GUIDES[0].type) const activeStore = computed(() => STORE_GUIDES.find(s => s.type === activeStoreType.value) ?? STORE_GUIDES[0])