diff --git a/ops-platform/src/api/ops.ts b/ops-platform/src/api/ops.ts index 8841deb..37e291d 100644 --- a/ops-platform/src/api/ops.ts +++ b/ops-platform/src/api/ops.ts @@ -49,6 +49,25 @@ export interface ServiceRequest { reviewNote?: string createdAt: string reviewedAt?: string + tenant?: { + id: string + username: string + nickname: string + email: string + phone?: string + type: 'MAIN' | 'SUB' + status: 'ACTIVE' | 'DISABLED' | 'PENDING_EMAIL' + } | null + app?: { + id: string + appKey: string + name: string + packageName: string + iosBundleId?: string + harmonyBundleName?: string + tenantId: string + createdAt: string + } | null } export interface ServiceRequestPage { diff --git a/ops-platform/src/views/services/ServiceRequestsView.vue b/ops-platform/src/views/services/ServiceRequestsView.vue index 94bd5e6..9934708 100644 --- a/ops-platform/src/views/services/ServiceRequestsView.vue +++ b/ops-platform/src/views/services/ServiceRequestsView.vue @@ -11,6 +11,22 @@ + + + + + + @@ -260,36 +260,47 @@ + + + + - + 比例 成员 - + @@ -700,6 +711,7 @@ const storeConfigs = ref([]) const loadingPublishConfig = ref(false) const savingPublishConfig = ref(false) const publishConfigForm = ref({ + allowAnonymousUpdateCheck: false, defaultGrayPercent: 0, grayMode: 'PERCENT' as GrayMode, graySelectionSource: 'LOCAL' as GraySelectionSource, @@ -734,6 +746,7 @@ const loadingOperationLogs = ref(false) const hasGraySelectCallback = computed(() => Boolean(publishConfigForm.value.graySelectCallbackUrl.trim())) const hasGrayDirectorySyncCallback = computed(() => Boolean(publishConfigForm.value.grayDirectorySyncCallbackUrl.trim())) const hasAnyGrayCallback = computed(() => hasGraySelectCallback.value || hasGrayDirectorySyncCallback.value) +const allowAnonymousUpdateCheck = computed(() => Boolean(publishConfigForm.value.allowAnonymousUpdateCheck)) type FieldDef = { key: string; label: string; type?: 'password' | 'textarea'; placeholder?: string } type GuideStep = { title: string; description: string } @@ -1041,6 +1054,7 @@ function normalizePublishConfig(raw: Record | null | undefined) const grayMode = String(raw?.grayMode ?? 'PERCENT') as GrayMode const graySelectionSource = String(raw?.graySelectionSource ?? 'LOCAL') as GraySelectionSource return { + allowAnonymousUpdateCheck: Boolean(raw?.allowAnonymousUpdateCheck ?? raw?.defaultAllowAnonymousUpdateCheck ?? false), defaultGrayPercent: Number((raw as Record)?.defaultGrayPercent ?? 0), grayMode, graySelectionSource, @@ -1067,6 +1081,10 @@ async function loadPublishConfig() { try { const res = await updateAdminApi.getPublishConfig(appKey) publishConfigForm.value = parsePublishConfig(res.data.data.configJson) + if (allowAnonymousUpdateCheck.value) { + publishConfigForm.value.grayMode = 'PERCENT' + publishConfigForm.value.graySelectionSource = 'LOCAL' + } if (publishConfigForm.value.grayMode === 'MEMBERS' && !hasAnyGrayCallback.value) { publishConfigForm.value.grayMode = 'PERCENT' } @@ -1090,6 +1108,10 @@ async function savePublishConfig() { graySelectCallbackUrl: normalizeCallbackUrl(publishConfigForm.value.graySelectCallbackUrl), grayDirectorySyncCallbackUrl: normalizeCallbackUrl(publishConfigForm.value.grayDirectorySyncCallbackUrl), } + if (payload.allowAnonymousUpdateCheck) { + payload.grayMode = 'PERCENT' + payload.graySelectionSource = 'LOCAL' + } if (payload.grayMode === 'MEMBERS' && !hasAnyGrayCallback.value) { ElMessage.warning('成员模式至少需要配置一个回调地址') return @@ -1161,6 +1183,10 @@ const grayForm = ref({ }) function openGrayDialog(row: { id: string }, type: 'app' | 'rn') { + if (allowAnonymousUpdateCheck.value) { + ElMessage.warning('当前应用开启了免登录检查更新,灰度发布已禁用') + return + } grayTarget.value = { id: row.id, type } grayForm.value = { enabled: true, @@ -1212,6 +1238,10 @@ async function syncGrayMembers() { async function submitGray() { if (!grayTarget.value) return + if (allowAnonymousUpdateCheck.value) { + ElMessage.warning('当前应用开启了免登录检查更新,灰度发布已禁用') + return + } if (grayForm.value.enabled && grayForm.value.grayMode === 'MEMBERS' && grayForm.value.selectionSource === 'LOCAL' && !hasGrayDirectorySyncCallback.value) { ElMessage.warning('未配置成员目录同步回调,无法选择本地成员') return