fix: 站点编辑实现编辑弹窗+PUT端点, 配置查看修复(加载失败)改用/content端点+DTO加submitterId

This commit is contained in:
mediabot-pt
2026-06-30 00:32:14 +08:00
parent 48d0e6a247
commit 550535f882
9 changed files with 158 additions and 10 deletions

View File

@@ -81,19 +81,29 @@ const handleView = async (row) => {
showHistory.value = false
viewVisible.value = true
try {
const res = await api.configs.download(row.siteId, row.version)
configContent.value = typeof res === 'string' ? res : JSON.stringify(res, null, 2)
} catch {
configContent.value = '(加载失败)'
const resp = await api.configs.content(row.siteId, row.version)
const content = resp.data
if (content) {
configContent.value = typeof content === 'string' ? content : JSON.stringify(content, null, 2)
} else {
configContent.value = '(无配置内容)'
}
} catch (e) {
configContent.value = '(加载失败: ' + (e.response?.data?.message || e.message || '未知错误') + ')'
}
}
const loadHistoryConfig = async (h) => {
try {
const res = await api.configs.download(h.siteId, h.version)
configContent.value = typeof res === 'string' ? res : JSON.stringify(res, null, 2)
} catch {
configContent.value = '(加载失败)'
const resp = await api.configs.content(h.siteId, h.version)
const content = resp.data
if (content) {
configContent.value = typeof content === 'string' ? content : JSON.stringify(content, null, 2)
} else {
configContent.value = '(无配置内容)'
}
} catch (e) {
configContent.value = '(加载失败: ' + (e.response?.data?.message || e.message || '未知错误') + ')'
}
}