Commit 74c42368 by 蒋勇

d

parent c1aaceed
......@@ -38,6 +38,14 @@ class UserCtl extends CtlBase {
return rtn;
}
async create(p, q, req){
//检查是否有用户名和密码
if (!pobj.userName) {
return system.getResult(null, "请检查用户名和密码是否存在")
}
let rtn = await this.service.registerByTantent(p, q);
return rtn;
}
//登录后的租户创建属于租户的用户
//需要在控制器里取出公司ID
//和租户绑定同一家公司
......@@ -45,7 +53,7 @@ class UserCtl extends CtlBase {
//控制器端检查用户名和密码非空
async registerByTantent(p, q, req) {
//检查是否有用户名和密码
if (!pobj.userName || !pobj.password) {
if (!pobj.userName) {
return system.getResult(null, "请检查用户名和密码是否存在")
}
let rtn = await this.service.registerByTantent(p, q);
......
......@@ -103,7 +103,7 @@ class UserService extends ServiceBase {
//先
let userfind = await self.dao.model.findOne({
where: { userName: p.userName, app_id: settings.pmappid },
attributes: ['userName', 'nickName','headUrl','jwtkey','jwtsecret'],
attributes: ['userName', 'nickName','headUrl','jwtkey','jwtsecret','created_at','isSuper','isAdmin'],
include: [{ model: self.db.models.company, raw: true, attributes: ["companykey"] }]
});
......@@ -122,7 +122,7 @@ class UserService extends ServiceBase {
async getUserInfo(uname){
let userfind = await this.dao.model.findOne({
where: { userName: uname, app_id: settings.pmappid },
attributes: ['userName', 'nickName',"headUrl"],
attributes: ['userName', 'nickName',"headUrl",'isSuper','isAdmin'],
include: [{ model: this.db.models.company, raw: true, attributes: ["companykey"] }]
});
return userfind;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment