From f116b6336993f8762d689a28845be3eb03f4cd5c Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Thu, 11 Jun 2026 12:30:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(update):=20=E9=87=8D=E6=9E=84=E7=81=B0?= =?UTF-8?q?=E5=BA=A6=E5=8F=91=E5=B8=83=E7=B3=BB=E7=BB=9F=E5=B9=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=A0=87=E7=AD=BE=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 灰度模式简化为 PERCENT 和 MEMBERS 两种 - 新增成员标签系统,支持标签 CRUD 和按标签选择发版 - 成员同步保留已有标签,手动成员不受同步影响 - 支持标签 + 额外成员组合选择:groupNames + extraMemberIds - 发布时回调集成方获取成员列表,支持 AppSecret 签名验证 - 从 IM 服务导入成员功能 - 修复 isInGrayRelease() 中的 String.contains() 误匹配 bug - 移除 IM_PUSH_USERS、CUSTOMER_SYNC、CUSTOMER_CALLBACK 模式 - 更新前端界面,优化灰度成员选择体验 - 添加发布配置和操作日志等相关数据库表结构 --- tenant-platform/src/api/update.ts | 71 +++-- .../views/update/VersionManagementView.vue | 251 ++++++++---------- 2 files changed, 163 insertions(+), 159 deletions(-) diff --git a/tenant-platform/src/api/update.ts b/tenant-platform/src/api/update.ts index 6de4276..c645895 100644 --- a/tenant-platform/src/api/update.ts +++ b/tenant-platform/src/api/update.ts @@ -83,7 +83,6 @@ export type StoreType = 'HUAWEI' | 'MI' | 'OPPO' | 'VIVO' | 'HONOR' | 'APP_STORE export type StoreReviewState = 'PENDING' | 'SUBMITTING' | 'UNDER_REVIEW' | 'APPROVED' | 'REJECTED' export type PublishMode = 'MANUAL' | 'NOW' | 'SCHEDULED' | 'AUTO_REVIEW' export type GrayMode = 'PERCENT' | 'MEMBERS' -export type GraySelectionSource = 'LOCAL' | 'CALLBACK' export interface PublishConfig { id: string @@ -107,15 +106,15 @@ export interface OperationLog { export interface GrayMember { userId: string - name?: string - groupName?: string - extraJson?: string - updatedAt?: string + name: string + source: 'SYNC' | 'MANUAL' + active: boolean + tags: string[] } -export interface GrayMemberGroup { - groupName: string - members: GrayMember[] +export interface GrayTag { + tagName: string + memberCount: number } export interface StoreConfig { @@ -264,8 +263,8 @@ export const updateAdminApi = { enabled: boolean grayMode: GrayMode percent?: number - memberIds?: string[] - selectionSource?: GraySelectionSource + groupNames?: string[] + extraMemberIds?: string[] }) { return updateClient.post(`/api/v1/updates/app/${id}/gray`, body) }, @@ -298,8 +297,8 @@ export const updateAdminApi = { enabled: boolean grayMode: GrayMode percent?: number - memberIds?: string[] - selectionSource?: GraySelectionSource + groupNames?: string[] + extraMemberIds?: string[] }) { return updateClient.post(`/api/v1/rn/${id}/gray`, body) }, @@ -404,15 +403,47 @@ export const updateAdminApi = { }) }, - listGrayMembers(appKey: string, keyword?: string, groupName?: string) { - return updateClient.get<{ data: GrayMemberGroup[] }>('/api/v1/updates/gray/members', { - params: { appKey, ...(keyword && { keyword }), ...(groupName && { groupName }) }, - }) - }, - - syncGrayMembers(appKey: string) { - return updateClient.post<{ data: GrayMemberGroup[] }>('/api/v1/updates/gray/members/sync', null, { + listGrayMembers(appKey: string) { + return updateClient.get<{ data: GrayMember[] }>('/api/v1/updates/gray/members', { params: { appKey }, }) }, + + addGrayMembers(appKey: string, userIds: string[], name?: string) { + return updateClient.post('/api/v1/updates/gray/members', { appKey, userIds, name }) + }, + + deleteGrayMember(appKey: string, userId: string) { + return updateClient.delete(`/api/v1/updates/gray/members/${userId}`, { params: { appKey } }) + }, + + syncGrayMembers(appKey: string, members: { userId: string; name?: string }[]) { + return updateClient.post<{ data: { added: number; updated: number; removed: number } }>( + '/api/v1/updates/gray/members/sync', { appKey, members }) + }, + + importGrayMembersFromIm(appKey: string) { + return updateClient.post<{ data: { added: number; updated: number; removed: number } }>( + '/api/v1/updates/gray/members/import-im', null, { params: { appKey } }) + }, + + listGrayTags(appKey: string) { + return updateClient.get<{ data: GrayTag[] }>('/api/v1/updates/gray/tags', { params: { appKey } }) + }, + + createGrayTag(appKey: string, tagName: string, userIds: string[]) { + return updateClient.post('/api/v1/updates/gray/tags', { appKey, tagName, userIds }) + }, + + deleteGrayTag(appKey: string, tagName: string) { + return updateClient.delete(`/api/v1/updates/gray/tags/${tagName}`, { params: { appKey } }) + }, + + addMembersToTag(appKey: string, tagName: string, userIds: string[]) { + return updateClient.post(`/api/v1/updates/gray/tags/${tagName}/members`, { appKey, userIds }) + }, + + removeMembersFromTag(appKey: string, tagName: string, userIds: string[]) { + return updateClient.delete(`/api/v1/updates/gray/tags/${tagName}/members`, { data: { appKey, userIds } }) + }, } diff --git a/tenant-platform/src/views/update/VersionManagementView.vue b/tenant-platform/src/views/update/VersionManagementView.vue index 48753aa..cdd651e 100644 --- a/tenant-platform/src/views/update/VersionManagementView.vue +++ b/tenant-platform/src/views/update/VersionManagementView.vue @@ -335,26 +335,11 @@ @@ -417,7 +402,7 @@ - + @@ -429,51 +414,47 @@ -