From 588287a838d5f31488baac8e2d36d1fc6043c4a3 Mon Sep 17 00:00:00 2001 From: shenlei Date: Mon, 30 Nov 2026 10:22:52 +0900 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E6=89=93=E5=8C=85=E9=A1=B5=E3=80=8C?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E6=B7=B7=E6=B7=86=E3=80=8D=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=8D=E5=8B=BE=E9=80=89=EF=BC=8C=E6=97=A7=E5=88=86=E6=94=AF?= =?UTF-8?q?/=E6=97=A7=20Tag=20=E9=9C=80=E6=89=8B=E5=8A=A8=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E6=89=8D=E6=B7=B7=E6=B7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 分支 build_policy.json 声明 force_obfuscation 时仍强制混淆,不受勾选影响。 Co-Authored-By: Claude Opus 5.5 --- frontend/src/__tests__/BuildView.test.js | 13 +++++++------ frontend/src/views/BuildView.vue | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/__tests__/BuildView.test.js b/frontend/src/__tests__/BuildView.test.js index f049e77..829ccc4 100644 --- a/frontend/src/__tests__/BuildView.test.js +++ b/frontend/src/__tests__/BuildView.test.js @@ -52,7 +52,7 @@ describe('BuildView.vue', () => { expect(wrapper.text()).toContain('代码混淆') expect(wrapper.text()).toContain('build_policy.json') expect(wrapper.find('#obfuscation').exists()).toBe(true) - expect(wrapper.find('#obfuscation').element.checked).toBe(true) + expect(wrapper.find('#obfuscation').element.checked).toBe(false) }) it('加载 apps 和 schemes', async () => { @@ -121,7 +121,7 @@ describe('BuildView.vue', () => { await flushPromises() expect(wrapper.vm.form.build_type).toBe('') - expect(wrapper.vm.form.obfuscation).toBe(true) + expect(wrapper.vm.form.obfuscation).toBe(false) expect(wrapper.vm.form.branch).toBe('main') }) @@ -158,14 +158,14 @@ describe('BuildView.vue', () => { method: 'POST', })) const post = fetch.mock.calls.find(([url, opts]) => url === '/api/tasks' && opts?.method === 'POST') - expect(JSON.parse(post[1].body).obfuscation).toBe(true) + expect(JSON.parse(post[1].body).obfuscation).toBe(false) expect(wrapper.text()).toContain('打包任务已创建,正在排队,请勿重复点击。') expect(wrapper.vm.form.app_id).toBe('') expect(wrapper.vm.form.build_type).toBe('') expect(wrapper.vm.form.scheme_id).toBe('') }) - it('取消勾选混淆时提交 obfuscation=false(旧分支按勾选执行)', async () => { + it('勾选混淆时提交 obfuscation=true(旧分支按勾选执行)', async () => { fetch.mockImplementation((url, opts) => { if (url === '/api/tasks' && opts?.method === 'POST') { return Promise.resolve({ ok: true, json: () => Promise.resolve({ id: 'test-id', status: 'pending' }) }) @@ -184,12 +184,13 @@ describe('BuildView.vue', () => { wrapper.vm.selectedServer = '测试环境' await wrapper.vm.$nextTick() wrapper.vm.form.app_id = '1' - await wrapper.find('#obfuscation').setValue(false) + await wrapper.find('#obfuscation').setValue(true) await wrapper.find('.btn-primary').trigger('click') await flushPromises() const post = fetch.mock.calls.find(([url, opts]) => url === '/api/tasks' && opts?.method === 'POST') - expect(JSON.parse(post[1].body).obfuscation).toBe(false) + expect(JSON.parse(post[1].body).obfuscation).toBe(true) + expect(wrapper.vm.form.obfuscation).toBe(false) }) it('未选择 App 时提示', async () => { diff --git a/frontend/src/views/BuildView.vue b/frontend/src/views/BuildView.vue index 3321540..2dd3611 100644 --- a/frontend/src/views/BuildView.vue +++ b/frontend/src/views/BuildView.vue @@ -211,7 +211,7 @@ const form = ref({ build_type: '', scheme_id: '', exclude_symbols: false, - obfuscation: true, + obfuscation: false, branch: 'main', }) const submitting = ref(false) @@ -401,7 +401,7 @@ const submitTask = async () => { build_type: '', scheme_id: '', exclude_symbols: false, - obfuscation: Boolean(supportsObfuscation.value), + obfuscation: false, branch: branches.value[0] || 'main', } } else {