From c0f9bc1c47ba4919e6e273b103ed554adffc77ac Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Fri, 15 May 2026 22:11:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=A4=A7=E6=B3=A2=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tenant-platform/src/api/update.ts | 18 ++++ tenant-platform/src/env.d.ts | 1 + .../views/update/VersionManagementView.vue | 90 ++++++++++++++++++- tenant-platform/vite.config.ts | 4 + 4 files changed, 112 insertions(+), 1 deletion(-) diff --git a/tenant-platform/src/api/update.ts b/tenant-platform/src/api/update.ts index 717d934..d7b5913 100644 --- a/tenant-platform/src/api/update.ts +++ b/tenant-platform/src/api/update.ts @@ -330,6 +330,24 @@ export const updateAdminApi = { ) }, + cancelStoreReview(versionId: string, storeTypes?: StoreType[]) { + return updateClient.post<{ data: null }>( + `/api/v1/updates/store/app/${versionId}/cancel-review`, + storeTypes ? { storeTypes } : {}, + ) + }, + + updatePublishSchedule( + versionId: string, + publishType: 'IMMEDIATE' | 'SCHEDULED', + scheduledAt?: string, + ) { + return updateClient.put<{ data: AppVersion }>( + `/api/v1/updates/store/app/${versionId}/publish-schedule`, + { publishType, scheduledAt }, + ) + }, + getPublishConfig(appKey: string) { return updateClient.get<{ data: PublishConfig }>('/api/v1/updates/publish/config', { params: { appKey } }) }, diff --git a/tenant-platform/src/env.d.ts b/tenant-platform/src/env.d.ts index f9fc82a..c7db3d3 100644 --- a/tenant-platform/src/env.d.ts +++ b/tenant-platform/src/env.d.ts @@ -3,6 +3,7 @@ interface ImportMetaEnv { readonly VITE_API_BASE_URL: string readonly VITE_FILE_SERVICE_URL: string + readonly VITE_LICENSE_API_BASE_URL: string readonly BASE_URL: string } diff --git a/tenant-platform/src/views/update/VersionManagementView.vue b/tenant-platform/src/views/update/VersionManagementView.vue index c2b0fd9..d4a4389 100644 --- a/tenant-platform/src/views/update/VersionManagementView.vue +++ b/tenant-platform/src/views/update/VersionManagementView.vue @@ -572,7 +572,48 @@ + + + + + + + + 立即发布 + 定时发布 + + + + + + + @@ -1298,6 +1339,53 @@ const showStoreReviewDetail = ref(false) const storeReviewDetailVersion = ref(null) const storeReviewDetailItems = ref<{ store: string; state: string; reason?: string; stage?: string; submittedAt?: string; updatedAt?: string; batchId?: string }[]>([]) const storeReviewDetailLive = ref(false) +const cancellingReview = ref(false) +const showPublishSchedule = ref(false) +const publishScheduleType = ref<'IMMEDIATE' | 'SCHEDULED'>('IMMEDIATE') +const publishScheduleAt = ref('') +const updatingPublishSchedule = ref(false) + +async function handleCancelReview(storeType?: string) { + if (!storeReviewDetailVersion.value) return + const stores = storeType + ? [storeType] + : storeReviewDetailItems.value.filter(i => isActiveState(i.state)).map(i => i.store) + if (!stores.length) return + cancellingReview.value = true + try { + await updateAdminApi.cancelStoreReview(storeReviewDetailVersion.value.id, stores as any) + ElMessage.success('撤回请求已发送') + // Optimistically update local state + for (const s of stores) { + const idx = storeReviewDetailItems.value.findIndex(i => i.store === s) + if (idx >= 0) storeReviewDetailItems.value[idx] = { ...storeReviewDetailItems.value[idx], state: 'WITHDRAWN' } + } + await loadAppVersions() + } catch { + ElMessage.error('撤回失败,请稍后重试') + } finally { + cancellingReview.value = false + } +} + +async function handleUpdatePublishSchedule() { + if (!storeReviewDetailVersion.value) return + updatingPublishSchedule.value = true + try { + await updateAdminApi.updatePublishSchedule( + storeReviewDetailVersion.value.id, + publishScheduleType.value, + publishScheduleType.value === 'SCHEDULED' ? publishScheduleAt.value : undefined, + ) + ElMessage.success('发布计划已更新') + showPublishSchedule.value = false + await loadAppVersions() + } catch { + ElMessage.error('更新失败,请稍后重试') + } finally { + updatingPublishSchedule.value = false + } +} function openSubmitStoreDialog(row: AppVersion) { submitStoreVersion.value = row diff --git a/tenant-platform/vite.config.ts b/tenant-platform/vite.config.ts index 96e3425..1cb2618 100644 --- a/tenant-platform/vite.config.ts +++ b/tenant-platform/vite.config.ts @@ -42,6 +42,10 @@ export default defineConfig(({ mode }) => { server: { port: 5173, proxy: { + '/api/license': { + target: 'http://127.0.0.1:8085', + changeOrigin: true, + }, '/api/push': { target: 'http://127.0.0.1:8083', changeOrigin: true,