diff --git a/frontend/src/components/account/BulkEditAccountModal.vue b/frontend/src/components/account/BulkEditAccountModal.vue index baecd6f6..5cc9c2cc 100644 --- a/frontend/src/components/account/BulkEditAccountModal.vue +++ b/frontend/src/components/account/BulkEditAccountModal.vue @@ -599,6 +599,43 @@ + +
+
+ + +
+
+

+ {{ t('admin.accounts.openai.wsModeDesc') }} +

+

+ {{ t(openAIWSModeConcurrencyHintKey) }} +

+ + + + ` + }, ProxySelector: true, GroupSelector: true, Icon: true @@ -115,4 +129,33 @@ describe('BulkEditAccountModal', () => { } }) }) + + it('OpenAI OAuth 批量编辑应提交 OAuth 专属 WS mode 字段', async () => { + const wrapper = mountModal({ + selectedPlatforms: ['openai'], + selectedTypes: ['oauth'] + }) + + await wrapper.get('#bulk-edit-openai-ws-mode-enabled').setValue(true) + await wrapper.get('[data-testid="bulk-edit-openai-ws-mode-select"]').setValue('passthrough') + await wrapper.get('#bulk-edit-account-form').trigger('submit.prevent') + await flushPromises() + + expect(adminAPI.accounts.bulkUpdate).toHaveBeenCalledTimes(1) + expect(adminAPI.accounts.bulkUpdate).toHaveBeenCalledWith([1, 2], { + extra: { + openai_oauth_responses_websockets_v2_mode: 'passthrough', + openai_oauth_responses_websockets_v2_enabled: true + } + }) + }) + + it('OpenAI API Key 批量编辑不显示 WS mode 入口', () => { + const wrapper = mountModal({ + selectedPlatforms: ['openai'], + selectedTypes: ['apikey'] + }) + + expect(wrapper.find('#bulk-edit-openai-ws-mode-enabled').exists()).toBe(false) + }) })