fix: 自动去除 R2 自定义域名末尾的斜杠并精简表单提示
continuous-integration/drone/push Build is passing

This commit is contained in:
seahi committed 2026-08-14 18:27:49 +08:00
1 parent ee981b1785
commit b04d62a178
2 files changed
+7 -4

No files matched your search

+3 -1
View File
@@ -41,7 +41,9 @@ export const actions: Actions = {
},
{
key: 'r2.public_domain',
value: data.get('r2_public_domain')?.toString() || 'https://assets.yourdomain.com'
value: (
data.get('r2_public_domain')?.toString() || 'https://assets.yourdomain.com'
).replace(/\/+$/, '')
},
{
key: 'site.launch_date',
+4 -3
View File
@@ -74,8 +74,11 @@
required
/>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="r2_public_domain">R2 自定义域名 (用于访问附件)</label>
<label for="r2_public_domain">R2 自定义域名</label>
<input
type="text"
id="r2_public_domain"
@@ -83,7 +86,6 @@
value={data.settings['r2.public_domain'] || 'https://assets.yourdomain.com'}
placeholder="例如: https://assets.mydomain.com"
/>
<small class="form-hint">请确保不要以斜杠 / 结尾</small>
</div>
<div class="form-group">
<label for="site_launch_date">建站日期</label>
@@ -92,7 +94,6 @@
name="site_launch_date"
value={data.settings['site.launch_date'] || ''}
/>
<small class="form-hint">用于在底栏显示"感谢陪伴 X 天 X 小时"</small>
</div>
</div>