refactor(xumu): 优化获取详情数据接口及处理逻辑

- 修改请求接口地址:将 "/api/breed/death/page" 更改为 "/api/breed/death/getAuditPage"
- 优化数据处理逻辑:直接使用 res.data 代替 res.data.records[0]
This commit is contained in:
aixianling
2025-01-21 09:21:06 +08:00
parent 8daf15cf3f
commit 8a20db021a

View File

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