From eb85e53d3fac2d0eb7bcbdcd46ec9d2a774fbc4f Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Thu, 18 Jun 2026 11:14:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(jenkins):=20=E4=BF=AE=E5=A4=8DJenkins?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E4=B8=AD=E7=9A=84=E5=AD=97=E7=AC=A6=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E5=92=8CAPI=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在Jenkinsfile中添加JAVA_TOOL_OPTIONS环境变量设置UTF-8编码 - 在Windows批处理命令前添加chcp 65001命令解决中文字符显示问题 - 修复BugCollectIssues组件中API参数从type改为level - 修复BugCollectWebhooks组件中API字段映射eventTypes到events和cooldownSeconds到cooldownSec - 更新webhook请求数据结构以匹配后端API要求 --- Jenkinsfile | 21 ++++++++++++------- .../views/bug-collect/BugCollectIssues.vue | 2 +- .../views/bug-collect/BugCollectWebhooks.vue | 15 +++++++++---- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 152a928..2f6977b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,14 +8,15 @@ pipeline { } environment { - ACR_REGISTRY = 'crpi-n44qjpuucgjt8e8c.cn-beijing.personal.cr.aliyuncs.com' - ACR_NAMESPACE = 'xuqmgroup' - ACR_USERNAME = 'xuqinmin12' - PROD_HOST = '106.54.23.149' - PROD_USER = 'ubuntu' - COMPOSE_FILE = '/opt/xuqm/deploy/compose.production.yaml' - VERSIONS_FILE = '/opt/xuqm/deploy/versions.json' - DOCKER_BUILDKIT = '1' + ACR_REGISTRY = 'crpi-n44qjpuucgjt8e8c.cn-beijing.personal.cr.aliyuncs.com' + ACR_NAMESPACE = 'xuqmgroup' + ACR_USERNAME = 'xuqinmin12' + PROD_HOST = '106.54.23.149' + PROD_USER = 'ubuntu' + COMPOSE_FILE = '/opt/xuqm/deploy/compose.production.yaml' + VERSIONS_FILE = '/opt/xuqm/deploy/versions.json' + DOCKER_BUILDKIT = '1' + JAVA_TOOL_OPTIONS = '-Dfile.encoding=UTF-8 -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8' } options { @@ -81,6 +82,7 @@ pipeline { : "--build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ${latestImage}" def gitCommit = env.GIT_COMMIT ?: 'unknown' bat """ + chcp 65001 >nul docker login ${env.ACR_REGISTRY} -u ${env.ACR_USERNAME} -p %ACR_PASS% if %errorlevel% neq 0 exit /b 1 docker pull --platform=linux/amd64 ${latestImage} || echo Pull failed, will build fresh @@ -107,6 +109,7 @@ pipeline { def latestImage = "${env.ACR_REGISTRY}/${env.ACR_NAMESPACE}/${env.IMAGE_NAME}:latest" retry(2) { bat """ + chcp 65001 >nul ssh -i "%SSH_KEY%" -o StrictHostKeyChecking=no ${env.PROD_USER}@${env.PROD_HOST} "docker image prune -f 2>/dev/null || true; docker pull ${latestImage} || exit 1; docker compose -f ${env.COMPOSE_FILE} up -d --no-deps --force-recreate ${env.DEPLOY_SERVICE} || exit 1; docker image prune -f" """ } @@ -129,6 +132,7 @@ print('versions.json updated: ${svcName}=${svcVer}') """.stripIndent() writeFile file: 'update_versions_web.py', text: updateScript bat """ + chcp 65001 >nul scp -i "%SSH_KEY%" -o StrictHostKeyChecking=no update_versions_web.py ${env.PROD_USER}@${env.PROD_HOST}:/tmp/update_versions_web.py ssh -i "%SSH_KEY%" -o StrictHostKeyChecking=no ${env.PROD_USER}@${env.PROD_HOST} "python3 /tmp/update_versions_web.py && rm /tmp/update_versions_web.py" """ @@ -141,6 +145,7 @@ print('versions.json updated: ${svcName}=${svcVer}') stage('Commit Version') { steps { bat """ + chcp 65001 >nul git config user.email "jenkins@xuqm.com" git config user.name "Jenkins CI" git add ${env.VERSION_FILE} diff --git a/tenant-platform/src/views/bug-collect/BugCollectIssues.vue b/tenant-platform/src/views/bug-collect/BugCollectIssues.vue index ece1f80..1fb8aaf 100644 --- a/tenant-platform/src/views/bug-collect/BugCollectIssues.vue +++ b/tenant-platform/src/views/bug-collect/BugCollectIssues.vue @@ -138,7 +138,7 @@ async function loadData() { loading.value = true try { const res = await bugCollectApi.issues(appKey.value, { - type: filters.value.type || undefined, + level: filters.value.type || undefined, platform: filters.value.platform || undefined, startDate: filters.value.dateRange?.[0] || undefined, endDate: filters.value.dateRange?.[1] || undefined, diff --git a/tenant-platform/src/views/bug-collect/BugCollectWebhooks.vue b/tenant-platform/src/views/bug-collect/BugCollectWebhooks.vue index cecbbb9..4ff11d4 100644 --- a/tenant-platform/src/views/bug-collect/BugCollectWebhooks.vue +++ b/tenant-platform/src/views/bug-collect/BugCollectWebhooks.vue @@ -137,8 +137,8 @@ function openDialog(row?: BugCollectWebhook) { editingId.value = row.id form.value = { url: row.url, - eventTypes: [...row.eventTypes], - cooldownSeconds: row.cooldownSeconds, + eventTypes: [...row.events], + cooldownSeconds: row.cooldownSec, enabled: row.enabled, } } else { @@ -152,11 +152,18 @@ async function handleSave() { if (!form.value.url || !form.value.eventTypes.length) return saving.value = true try { + const requestData = { + appKey: appKey.value, + url: form.value.url, + events: form.value.eventTypes, + cooldownSec: form.value.cooldownSeconds, + enabled: form.value.enabled, + } if (editingId.value) { - await bugCollectApi.webhooks.update(editingId.value, form.value) + await bugCollectApi.webhooks.update(editingId.value, requestData) ElMessage.success('更新成功') } else { - await bugCollectApi.webhooks.create(appKey.value, form.value) + await bugCollectApi.webhooks.create(requestData) ElMessage.success('创建成功') } dialogVisible.value = false