在vue工程里面使用了
1 2 3 4 5 6 7 | confirmModify () { // 确认修改 updateUserInfo( this .userInfo).then((response)=> { alert( '修改成功' ); }). catch ( function (error) { console.log(error); }); } |
点击后没有更新成功,没有返回错误信息,数据库没有更新。但是我用获取用户信息就可以正常:
1 2 3 4 5 6 7 | getUserInfo () { //请求用户信息 getUserDetail().then((response)=> { this .userInfo = response.data; }). catch ( function (error) { console.log(error); }); }, |
1 2 3 4 5 6 7 8 | userInfo: { username: '' , gender: '' , birthday: '' , email: '' , mobile: '' , image: '' , }, |
我在http://localhost:8000/docs/#users-update 可以正常更新,请问怎么知道哪里出错了?
Django REST framework课程视频,RESTFul API前后端分离开发
了解课程