From fcaafdc807a44360c5417301ee46ce780ac0ad55 Mon Sep 17 00:00:00 2001 From: Sakurasan <26715255+Sakurasan@users.noreply.github.com> Date: Mon, 17 Aug 2026 20:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF:=20Base=20URL=20=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E9=99=90=E9=95=BF=20+=20=E5=88=97=E8=A1=A8=E6=88=AA?= =?UTF-8?q?=E6=96=AD=E9=98=B2=E6=92=91=E7=A0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Input 组件支持 maxlength 透传 - 渠道表单 4 个 Base URL 输入框限 255 字符 - 渠道列表 Base URL 单元格截断显示(max-w-220px) Co-Authored-By: Claude --- web/src/components/ui/Input.vue | 2 ++ web/src/views/admin/ChannelsView.vue | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/src/components/ui/Input.vue b/web/src/components/ui/Input.vue index 3c296a5..441eba4 100644 --- a/web/src/components/ui/Input.vue +++ b/web/src/components/ui/Input.vue @@ -9,6 +9,7 @@ withDefaults( error?: string autocomplete?: string disabled?: boolean + maxlength?: number }>(), { type: 'text', modelValue: '', disabled: false }, ) @@ -24,6 +25,7 @@ const emit = defineEmits<{ 'update:modelValue': [string | number] }>() :placeholder="placeholder" :autocomplete="autocomplete" :disabled="disabled" + :maxlength="maxlength" class="h-10 w-full rounded-md border border-edge2 bg-surface px-3 text-sm text-ink placeholder-muted outline-none transition focus:border-accent focus:ring-2 focus:ring-accent disabled:cursor-not-allowed disabled:opacity-50" :class="error && 'border-err focus:border-err focus:ring-err'" @input="emit('update:modelValue', ($event.target as HTMLInputElement).value as string | number)" diff --git a/web/src/views/admin/ChannelsView.vue b/web/src/views/admin/ChannelsView.vue index 16dc780..c3398db 100644 --- a/web/src/views/admin/ChannelsView.vue +++ b/web/src/views/admin/ChannelsView.vue @@ -222,7 +222,7 @@ onMounted(load) >{{ protocolShort(f) }} - {{ ch.base_url }} + {{ ch.base_url }} {{ ch.api_key_masked || '****' }} @@ -288,13 +288,14 @@ onMounted(load) v-model="form.base_url" label="Base URL(可选)" placeholder="https://api.openai.com/v1" + :maxlength="255" hint="支持前缀或完整端点,如 https://api.openai.com/v1 或 https://api.openai.com/v1/chat/completions;留空按供应商默认" />

分协议 Base URL(可选,如智谱三种格式不同)

- - - + + +

网关按协议选对应 base_url 直通,无需为每种格式建多个渠道