5 分钟发布一次
This commit is contained in:
@@ -81,6 +81,9 @@ const publishConfig = computed(
|
||||
const salePriceConfig = computed(
|
||||
() => configs.value.find(item => item.key === 'listing.sale_price_config') || null
|
||||
)
|
||||
const listingPublishCooldownConfig = computed(
|
||||
() => configs.value.find(item => item.key === 'listing.publish_cooldown_minutes') || null
|
||||
)
|
||||
const homeAnnouncementsConfig = computed(
|
||||
() => configs.value.find(item => item.key === 'mobile.home_announcements') || null
|
||||
)
|
||||
@@ -128,6 +131,7 @@ const regularConfigs = computed(() =>
|
||||
item =>
|
||||
item.key !== 'listing.publish_options' &&
|
||||
item.key !== 'listing.sale_price_config' &&
|
||||
item.key !== 'listing.publish_cooldown_minutes' &&
|
||||
item.key !== 'mobile.home_announcements' &&
|
||||
item.key !== 'mobile.home_banners' &&
|
||||
item.key !== 'listing.publish_agreements' &&
|
||||
@@ -341,6 +345,14 @@ function formatHomeConfigStatus(row: SystemConfig | null, fallback: string) {
|
||||
return formatDateTime(row.updated_at, fallback)
|
||||
}
|
||||
|
||||
function formatPublishCooldown(value: string) {
|
||||
const trimmed = value.trim()
|
||||
if (!/^\d+$/.test(trimmed)) return '配置异常'
|
||||
const minutes = Number(trimmed)
|
||||
if (minutes === 0) return '已关闭'
|
||||
return `${minutes} 分钟`
|
||||
}
|
||||
|
||||
function formatConfigValue(row: SystemConfig) {
|
||||
if (row.key.includes('token')) {
|
||||
return row.value.trim() ? '已配置' : '未配置'
|
||||
@@ -398,6 +410,41 @@ function formatConfigValue(row: SystemConfig) {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="listingPublishCooldownConfig" class="publish-config-panel">
|
||||
<div class="publish-config-main">
|
||||
<div>
|
||||
<p class="eyebrow">Publish Guard</p>
|
||||
<h2>发布频率限制</h2>
|
||||
<span>限制同一用户新增发布账号的间隔,默认 5 分钟;填 0 可关闭限制。</span>
|
||||
</div>
|
||||
<el-button type="primary" @click="openEdit(listingPublishCooldownConfig)">
|
||||
编辑限制
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="publish-stat-grid home-stat-grid">
|
||||
<div class="publish-stat">
|
||||
<strong>{{ formatPublishCooldown(listingPublishCooldownConfig.value) }}</strong>
|
||||
<span>当前间隔</span>
|
||||
</div>
|
||||
<div class="publish-stat">
|
||||
<strong>用户维度</strong>
|
||||
<span>每个用户单独计算</span>
|
||||
</div>
|
||||
<div class="publish-stat">
|
||||
<strong>新增发布</strong>
|
||||
<span>不限制编辑和下架</span>
|
||||
</div>
|
||||
<div class="publish-stat">
|
||||
<strong>键</strong>
|
||||
<span>{{ listingPublishCooldownConfig.key }}</span>
|
||||
</div>
|
||||
<div class="publish-stat">
|
||||
<strong>更新</strong>
|
||||
<span>{{ formatHomeConfigStatus(listingPublishCooldownConfig, '未初始化') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="salePriceConfig" class="publish-config-panel">
|
||||
<div class="publish-config-main">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user