diff --git a/tenant-platform/src/api/app.ts b/tenant-platform/src/api/app.ts index 913e978..e5c5fae 100644 --- a/tenant-platform/src/api/app.ts +++ b/tenant-platform/src/api/app.ts @@ -196,17 +196,17 @@ export const appApi = { resetSecret: (appKey: string, code: string) => client.post<{ data: { appSecret: string } }>(`/apps/${appKey}/reset-secret`, { code }), - downloadLicenseFile: (appKey: string) => - client.get(`/apps/${appKey}/license-file`, { responseType: 'blob' }), + downloadConfigFile: (appKey: string) => + client.get(`/apps/${appKey}/config-file`, { responseType: 'blob' }), requestActivation: (appKey: string, serviceType: 'IM' | 'PUSH' | 'UPDATE' | 'LICENSE', reason: string) => client.post<{ data: null }>(`/apps/${appKey}/services/request-activation`, null, { params: { platform: 'ANDROID', serviceType, applyReason: reason }, }), - parseLicenseFile: (content: string) => + parseConfigFile: (content: string) => client.post<{ data: { appKey: string; appName: string; packageName: string; iosBundleId: string; harmonyBundleName: string; baseUrl: string; serverUrl: string } }>( - '/apps/license/parse', + '/apps/config/parse', { content }, ), } diff --git a/tenant-platform/src/views/apps/AppDetailView.vue b/tenant-platform/src/views/apps/AppDetailView.vue index afddd58..cc9979d 100644 --- a/tenant-platform/src/views/apps/AppDetailView.vue +++ b/tenant-platform/src/views/apps/AppDetailView.vue @@ -23,8 +23,8 @@ 重置 {{ app.description ?? '-' }} - - 下载 + + 下载 @@ -353,12 +353,12 @@ async function submitVerify() { } } -async function downloadLicenseFile() { +async function downloadConfigFile() { const current = app.value if (!current) return - const res = await appApi.downloadLicenseFile(current.appKey) + const res = await appApi.downloadConfigFile(current.appKey) const disposition = res.headers['content-disposition'] as string | undefined - const filename = parseFilename(disposition) ?? `${current.name || current.appKey}.xuqmlicense` + const filename = parseFilename(disposition) ?? `${current.name || current.appKey}.xuqmconfig` const url = URL.createObjectURL(res.data) const link = document.createElement('a') link.href = url diff --git a/tenant-platform/src/views/security/SecurityCenterView.vue b/tenant-platform/src/views/security/SecurityCenterView.vue index eef666a..8e18039 100644 --- a/tenant-platform/src/views/security/SecurityCenterView.vue +++ b/tenant-platform/src/views/security/SecurityCenterView.vue @@ -67,40 +67,40 @@ - + - +

- 上传已下载的 License 文件(.xuqmlicense),解析并验证文件内容。 + 上传已下载的 Config 文件(.xuqmconfig),解析并验证文件内容。

- 选择 License 文件 + 选择 Config 文件 - 解析 - 清除 + 解析 + 清除
- - {{ licenseParseResult.appKey }} - {{ licenseParseResult.appName || '-' }} - {{ licenseParseResult.packageName || '-' }} - {{ licenseParseResult.iosBundleId || '-' }} - {{ licenseParseResult.harmonyBundleName || '-' }} - {{ licenseParseResult.serverUrl || licenseParseResult.baseUrl || '-' }} + + {{ configParseResult.appKey }} + {{ configParseResult.appName || '-' }} + {{ configParseResult.packageName || '-' }} + {{ configParseResult.iosBundleId || '-' }} + {{ configParseResult.harmonyBundleName || '-' }} + {{ configParseResult.serverUrl || configParseResult.baseUrl || '-' }}
@@ -286,10 +286,10 @@ const selectedApp = ref(null) const dialogMode = ref<'REVEAL_SECRET' | 'RESET_SECRET'>('REVEAL_SECRET') const secretResult = ref('') -// License file parse -const licenseFileContent = ref('') -const parsingLicense = ref(false) -const licenseParseResult = ref<{ +// Config file parse +const configFileContent = ref('') +const parsingConfig = ref(false) +const configParseResult = ref<{ appKey: string appName: string packageName: string @@ -298,42 +298,42 @@ const licenseParseResult = ref<{ baseUrl: string serverUrl: string } | null>(null) -const licenseUploadRef = ref(null) +const configUploadRef = ref(null) const isMobile = ref(false) function updateViewport() { isMobile.value = window.innerWidth < 768 } -function handleLicenseFileChange(file: any) { +function handleConfigFileChange(file: any) { const reader = new FileReader() reader.onload = (e) => { - licenseFileContent.value = (e.target?.result as string) || '' + configFileContent.value = (e.target?.result as string) || '' } reader.readAsText(file.raw) } -async function parseLicense() { - if (!licenseFileContent.value.trim()) { - ElMessage.warning('请输入或上传 License 文件内容') +async function parseConfig() { + if (!configFileContent.value.trim()) { + ElMessage.warning('请输入或上传 Config 文件内容') return } - parsingLicense.value = true + parsingConfig.value = true try { - const res = await appApi.parseLicenseFile(licenseFileContent.value.trim()) - licenseParseResult.value = res.data.data + const res = await appApi.parseConfigFile(configFileContent.value.trim()) + configParseResult.value = res.data.data ElMessage.success('解析成功') } catch (e: any) { ElMessage.error(e?.response?.data?.message || '解析失败,请检查文件内容') } finally { - parsingLicense.value = false + parsingConfig.value = false } } -function clearLicenseParse() { - licenseFileContent.value = '' - licenseParseResult.value = null - if (licenseUploadRef.value) { - licenseUploadRef.value.clearFiles() +function clearConfigParse() { + configFileContent.value = '' + configParseResult.value = null + if (configUploadRef.value) { + configUploadRef.value.clearFiles() } }