wxagame.weixin.qq.com network is down
发布于 5 年前 作者 jun59 4468 次浏览 来自 问答

我在使用baidu ai 的 bankcard 功能 识别银行卡号时,通过 wx.request 发请求后,提示 wxagame.weixin.qq.com network is down .求救!

getBankCard() {

// let tmpStr = ‘https://aip.baidubce.com/rest/2.0/ocr/v1/bankcard?access_token=’ + “’” + this.data.access_token + “’”

// console.log(tmpStr)

let that = this;

console.log(that.data)

console.log(that.data.imagePath)

// console.log(“getBankCard is begginning…”)

wx.request({

url: https://aip.baidubce.com/rest/2.0/ocr/v1/bankcard?access_token= + this.data.access_token,

data: {

‘image’: that.data.imageBase64

},

method: “POST”,

header: { ‘content-type’: ‘application/x-www-form-urlencoded’ },

success: (res) => {

console.log(“success: statusCode:”)

console.log(res.statusCode)

that.setData({

bankCardNumber: res.data[‘result’][‘bank_card_number’]

})

},

fail: () => {

console.log(“get bankCardNumber fail”)

},

complete: () => {

// console.log(“complete translate data…”)

}

})

// console.log(“getBankCard is complete…”)

},

回到顶部