Commit fd585091 by 蒋勇

d

parent a74c5230
......@@ -175,7 +175,8 @@ class UserCtl extends CtlBase {
pobj.u.password = super.encryptPasswd(pobj.u.password);
const cid = req.companyid;
pobj.u.company_id = cid;
var u = await this.service.register(pobj.u);
var company = await this.companyS.findById(cid);
var u = await this.service.register(pobj.u,company.siteTheme);
//req.session.user=u;
return system.getResult2(u);
}
......
const pmgnode = require("../subsys/pmg");
const entcenternode = require("../subsys/entcenter");
const policycenter= require("../subsys/policycenter");
const personcenternode = require("../subsys/personcenter");
module.exports = {
"appid": "wx76a324c5d201d1a4",
......@@ -22,6 +23,7 @@ module.exports = {
},
pmgnode,
entcenternode,
policycenter,
personcenternode,
{
"code": "toolCenter",
......
module.exports= {
"code": "policycenter",
"isleft": true,
"label": "政策中心",
"icon": "el-icon-menu",
"isSubmenu": true,
"children": [
{
"code": "bizmag", "isGroup": true, "icon": "fa fa-outdent", "label": "政策工具", "children": [
{
"code": "tool1",
"label": "工具1",
"isMenu": true,
"bizCode": "tool1",
"bizConfig": null,
"path": ""
},
{
"code": "tool2",
"label": "工具2",
"isMenu": true,
"bizCode": "tool2",
"bizConfig": null,
"path": ""
},
]
}
//------------------------------------------------企业中心左边菜单配置-------------------------------结束
],
};
\ No newline at end of file
......@@ -95,13 +95,16 @@ class UserService extends ServiceBase {
return this.dao.getAuths(userid);
}
async register(userinfo) {
async register(userinfo,theme) {
var self = this;
return this.db.transaction(function (t) {
return self.dao.create(userinfo, t).then(async function (user) {
//按照code查询出角色,设置默认访客角色
if(user.company_id!=1){
var role = await self.roleDao.model.findOne({ where: { code: "guest" }, transaction: t });
if(theme && theme=="policy"){
role = await self.roleDao.model.findOne({ where: { code: "policy" }, transaction: t });
}
console.log(role);
await user.setRoles([role], { transaction: t });
}
......
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