refactor(xumu): 优化获取详情数据接口及处理逻辑
- 修改请求接口地址:将 "/api/breed/death/page" 更改为 "/api/breed/death/getAuditPage" - 优化数据处理逻辑:直接使用 res.data 代替 res.data.records[0]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user