fix(xumu): 修复审计页面数据获取问题
- 在 AppDeathAudit 和 AppOutAudit 组件中,修改了 getDetail 方法 - 从 API 响应中获取正确的数据结构,确保详细信息正确显示 - 优化了代码格式,提高了可读性
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user