feat: implement system configuration page with core settings for S2A, pooling, and proxy.

This commit is contained in:
2026-01-30 08:10:04 +08:00
parent c242bc0c10
commit 38a58c138d

View File

@@ -35,7 +35,7 @@ export default function Config() {
try { try {
const res = await fetch('/api/config') const res = await fetch('/api/config')
const data = await res.json() const data = await res.json()
if (data.success) { if (data.code === 0 && data.data) {
setEditS2ABase(data.data.s2a_api_base || '') setEditS2ABase(data.data.s2a_api_base || '')
setEditS2AKey(data.data.s2a_admin_key || '') setEditS2AKey(data.data.s2a_admin_key || '')
setEditConcurrency(data.data.concurrency || 2) setEditConcurrency(data.data.concurrency || 2)
@@ -80,11 +80,11 @@ export default function Config() {
}), }),
}) })
const data = await res.json() const data = await res.json()
if (data.success) { if (data.code === 0) {
setMessage({ type: 'success', text: '配置已保存' }) setMessage({ type: 'success', text: '配置已保存' })
fetchServerConfig() fetchServerConfig()
} else { } else {
setMessage({ type: 'error', text: data.error || '保存失败' }) setMessage({ type: 'error', text: data.message || '保存失败' })
} }
} catch (error) { } catch (error) {
setMessage({ type: 'error', text: '网络错误' }) setMessage({ type: 'error', text: '网络错误' })