问题遇到的现象和发生背景
uni-app调用扫码接口,拿到扫码识别的数据传递给后端,传值为空密,接口没有数据返回,
问题相关代码,请勿粘贴截图
uni.scanCode({
success: (res) => {
console.log('res==>',res)
var result = res.result.substr(30)
// result.substr(25)
// this.result = result
// this.result = 'Hvu+7IQ2lau8HxCpYqFhoq/RBfByK8WhTKSr9InIeYsPuxbo4zMyew=='
this.scanType = res.scanType
this.charSet = res.charSet
console.log('this.result',this.result)
console.log('this.scanType',this.scanType)
console.log(JSON.stringify( 'res==>>' ,res))
validation({
securityCode: result
}).then(res => {
if (res.errcode === 0) {
// this.tui.toast('验证码', 5000);
console.log('res.position',res)
uni.$emit('update',{msg: res})
}
}
)