This commit is contained in:
lwg 2017-07-11 10:17:44 +08:00
parent 8de4d10e8d
commit 6014f8b524
3 changed files with 4 additions and 3 deletions

View File

@ -31,6 +31,7 @@
"mongoose": "4.10.8",
"mongoose-auto-increment": "^5.0.1",
"node-sass-china": "^4.5.0",
"sha1": "^1.1.1",
"redux": "^3.7.1",
"ykit-config-antd": "^0.1.3",
"ykit-config-react": "^0.4.4"

View File

@ -61,7 +61,7 @@ class userController extends baseController{
async reg(ctx){ //注册
var userInst = yapi.getInst(userModel);
let params = ctx.request.body; //获取请求的参数,检查是否存在用户名和密码
let result = await userInst.findByName(params.username);
//let result = await userInst.findByName(params.username);
if(!params.username){
return ctx.body = yapi.commons.resReturn(null,400,'用户名不能为空');
}

View File

@ -50,12 +50,12 @@ class userModel extends baseModel{
}
del (id) {
return this.model.deleteOne({
_id: id
_id: id
})
}
update(id,data){
return this.model.update({
_id: id,
_id: id
},{
username: data.username,
password: data.password,