fix(xumu): 修复审计页面数据获取问题

- 在 AppDeathAudit 和 AppOutAudit 组件中,修改了 getDetail 方法
- 从 API 响应中获取正确的数据结构,确保详细信息正确显示
- 优化了代码格式,提高了可读性
This commit is contained in:
aixianling
2025-01-21 10:09:13 +08:00
parent fde372007f
commit a059d2bd57
2 changed files with 35 additions and 35 deletions

View File

@@ -35,8 +35,8 @@ export default {
getDetail() {
const {id} = this.$route.query
return id && this.instance.post("/api/breed/death/getAuditPage", {id}).then(res => {
if (res?.data) {
const detail = res.data || {}
if (res?.data?.records?.[0]) {
const detail = res.data.records[0] || {}
if (detail.picture) {
Object.entries(JSON.parse(detail.picture)).forEach(([key, value]) => {
detail[key] = value

View File

@@ -42,8 +42,8 @@ export default {
getDetail() {
const { id } = this.$route.query
return id && this.instance.post("/api/breed/out/getAuditPage", { id }).then(res => {
if (res?.data) {
const detail = res.data
if (res?.data?.records?.[0]) {
const detail = res.data.records[0] || {}
return this.detail = { ...detail }
}
})