feat: 支持隐藏后台登录入口按钮

This commit is contained in:
shaw
2025-09-08 12:19:14 +08:00
parent e824858d60
commit f284d5666f
4 changed files with 196 additions and 3 deletions

View File

@@ -5396,6 +5396,7 @@ router.get('/oem-settings', async (req, res) => {
siteName: 'Claude Relay Service',
siteIcon: '',
siteIconData: '', // Base64编码的图标数据
showAdminButton: true, // 是否显示管理后台按钮
updatedAt: new Date().toISOString()
}
@@ -5425,7 +5426,7 @@ router.get('/oem-settings', async (req, res) => {
// 更新OEM设置
router.put('/oem-settings', authenticateAdmin, async (req, res) => {
try {
const { siteName, siteIcon, siteIconData } = req.body
const { siteName, siteIcon, siteIconData, showAdminButton } = req.body
// 验证输入
if (!siteName || typeof siteName !== 'string' || siteName.trim().length === 0) {
@@ -5456,6 +5457,7 @@ router.put('/oem-settings', authenticateAdmin, async (req, res) => {
siteName: siteName.trim(),
siteIcon: (siteIcon || '').trim(),
siteIconData: (siteIconData || '').trim(), // Base64数据
showAdminButton: showAdminButton !== false, // 默认为true
updatedAt: new Date().toISOString()
}