共计 751 个字符,预计需要花费 2 分钟才能阅读完成。
公共 jacecom.js
import api from './index.js'
const tiyanAll = {async tiyanApis(apidata){return new Promise((resolve,reject)=>{api.get(apidata, {}, (response) => {if (response.status >= 200 && response.status < 300) {
let data = response.data.data;
resolve(data)
}
})
})
},
async ticketApi(apidata){return new Promise((resolve,reject)=>{api.get(apidata, {},(response) => {if (response.status >= 200 && response.status < 300) {
let data = response.data.data;
resolve(data)
}
})
})
}
}
export default tiyanAll;
index.vue 中:
async tiyanApi(){
let letobjApi = {
reportApi:'/rest76/user/vip_goods_of_report',
ticketApi:'/rest76/pay/ticket'
}
let tiyanArr = await this.$jianCe.tiyanApis(letobjApi.reportApi)
console.log(tiyanArr,'datass')
let ticketdate = await this.$jianCe.ticketApi(letobjApi.ticketApi)
console.log(ticketdate,'ticketdate')
},
正文完