refactor(url): remove automatic trailing slash stripping from base URL inputs

- Remove `.replace(/\/+$/, "")` from all base URL handlers in useBaseUrlState.ts
- Remove trailing slash stripping in useCodexConfigState.ts
- Remove trailing slash normalization in providerConfigUtils.ts setCodexBaseUrl()
- Update i18n hints (en/ja/zh) to instruct users to avoid trailing slashes

This gives users explicit control over URL format rather than silently modifying input.
This commit is contained in:
Jason
2025-11-29 20:52:29 +08:00
parent 526c7406fa
commit 3bf37cf0ff
6 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -453,7 +453,7 @@ export const setCodexBaseUrl = (
// 归一化原文本中的引号(既能匹配,也能输出稳定格式)
const normalizedText = normalizeQuotes(configText);
const normalizedUrl = trimmed.replace(/\s+/g, "").replace(/\/+$/, "");
const normalizedUrl = trimmed.replace(/\s+/g, "");
const replacementLine = `base_url = "${normalizedUrl}"`;
const pattern = /base_url\s*=\s*(["'])([^"']+)\1/;