mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
user
This commit is contained in:
parent
8de4d10e8d
commit
6014f8b524
@ -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"
|
||||
|
@ -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,'用户名不能为空');
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user