await wx.cloud.callFunction({
name: 'create',
data: {
type: 'product',
city: this.data.city,
district: this.data.district
}
}).then(r => {
console.log(r)
order_id = r.result
return <---------
}).catch(e => {
modal.showCreateError()
return <---------
})
两个return测试都没法stop,程序一样照运行下去,有什麽方式强制stop呢?
因为我想控制条件然後强制stop呀!!!
可以用throw new Error();
Object.keys(data).map(item => { if (!data[item]) throw new Error('参数不全'); })