fix: 站点编辑实现编辑弹窗+PUT端点, 配置查看修复(加载失败)改用/content端点+DTO加submitterId
This commit is contained in:
@@ -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 || '未知错误') + ')'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user