|
此前,数据修改功能很正常。今天修改了几条数据,出现了修改的字段数据有,没有修改的字段数据全没有了。
我的相关代码:
远程函数:
yshsl_list.upinfo = async()=> {
try {
let id = req.body.id;
if (id) {
let body = req.body;
const result = await yshsl_list.upsert(body);
return Models.util.success(result);
}
return Models.util.error(4001, 'not login');
} catch(e) {
Models.api.console(e);
return Models.util.error(5000, 'Internal error');
}
};
本地代码:
var param = {'id':this.data.id,'type':this.data.genderDesc,'xh':this.data.selectorValue+1};
if (!this.data.id) {
api.toast({
msg:'id为空,更新失败...'
})
return
};
var that = this;
var path='yshsl_lists/upinfo';
var url= path ;//+ '?where=' + JSON.stringify(where);
$kn.ajax({
url: url,
method: 'post',
data: {
body: param
}
}, function(ret, err) {
if (ret.data) {
api.toast({
msg:'更新成功'
});
};
});
|
|