提交 96ea4033 编写于 作者: W wanganxp

完善报错

上级 efb16fdd
......@@ -36,7 +36,7 @@
}
},
onLoad() {
},
methods: {
bindPickerManChange: function(e) {
......@@ -55,7 +55,7 @@
const match = uniCloud.importObject("match")
const res = await match.test(that.array[that.indexman],that.array[that.indexwoman])
// console.log(res);
that.resContent = res.data.result
that.resContent = res.data
// that.showContent = "display"
that.isLoading = false
} catch (e) {
......
......@@ -10,18 +10,31 @@ module.exports = {
}
}
const sURL = "http://apis.juhe.cn/xzpd/query?key=353f51d561e2180ffd5e60f43fdd9c2a&men=" + men + "&women=" + women
console.log("sURL: ",sURL);
const res = await uniCloud.httpclient.request(
sURL,
{
"dataType": 'json'
// console.log("sURL: ",sURL);
try{
const res = await uniCloud.httpclient.request(sURL,{"dataType": 'json'})
console.log("res: ",res);
if (res.data.error_code==0) { //成功
return {
errCode: 0,
errMsg: "ok",
data: res.data.result
}
}
)
// console.log(res);
return {
errCode: 0,
errMsg: 'ok',
data: res.data
else{
return {
errCode: res.data.error_code,
errMsg: res.data.reason
}
}
}catch(e){
return e
// console.log("e: ",e);
// return {
// errCode: e.code,
// errMsg: e.message
// }
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册