Commit c2787859 by 宋毅

hzh

parent 9ddcc914
...@@ -183,6 +183,7 @@ class UserCtl extends CtlBase { ...@@ -183,6 +183,7 @@ class UserCtl extends CtlBase {
async loginByMobile(pobj, obj, req) { async loginByMobile(pobj, obj, req) {
const cid = req.companyid; const cid = req.companyid;
obj.u.cid = cid; obj.u.cid = cid;
var company = await this.companyS.findById(req.companyid);
var existedUser = await this.service.getUserByMobile(obj.u); var existedUser = await this.service.getUserByMobile(obj.u);
if (existedUser != null) { if (existedUser != null) {
req.session.user = existedUser; req.session.user = existedUser;
...@@ -192,7 +193,8 @@ class UserCtl extends CtlBase { ...@@ -192,7 +193,8 @@ class UserCtl extends CtlBase {
mobile: obj.u.mobile, mobile: obj.u.mobile,
userName: obj.u.mobile, userName: obj.u.mobile,
nickName: obj.u.mobile, nickName: obj.u.mobile,
company_id: obj.u.cid company_id: obj.u.cid,
themename:company.siteTheme
}; };
var result = await this.service.create(params); var result = await this.service.create(params);
req.session.user = result; req.session.user = result;
...@@ -275,13 +277,16 @@ class UserCtl extends CtlBase { ...@@ -275,13 +277,16 @@ class UserCtl extends CtlBase {
return { status: 1, msg: "用户已存在, 请修改并重试" }; return { status: 1, msg: "用户已存在, 请修改并重试" };
} else { } else {
obj.password = super.encryptPasswd(obj.password); obj.password = super.encryptPasswd(obj.password);
var company = await this.companyS.findById(req.companyid);
var params = { var params = {
userName: obj.mobile, userName: obj.mobile,
nickName: obj.mobile, nickName: obj.mobile,
mobile: obj.mobile, mobile: obj.mobile,
password: obj.password, password: obj.password,
company_id: req.companyid company_id: req.companyid,
themename:company.siteTheme
}; };
var result = await this.service.create(params); var result = await this.service.create(params);
return system.getResult2(result); return system.getResult2(result);
} }
......
...@@ -47,7 +47,7 @@ class MoneyJourneyService extends ServiceBase { ...@@ -47,7 +47,7 @@ class MoneyJourneyService extends ServiceBase {
} else { } else {
var b = year + "-" + i; var b = year + "-" + i;
} }
a.push({ name: b, receive: 0, pay: 0 }); a.push({ month: b, receive: 0, pay: 0 });
} }
} else { } else {
var b = month; var b = month;
......
...@@ -17,16 +17,15 @@ class UserService extends ServiceBase { ...@@ -17,16 +17,15 @@ class UserService extends ServiceBase {
await result.setRoles(roles, { transaction: t }); await result.setRoles(roles, { transaction: t });
} else { } else {
var role = await this.roleDao.model.findOne({ where: { code: "guest", company_id: result.company_id }, transaction: t }); var role = await this.roleDao.model.findOne({ where: { code: "guest", company_id: result.company_id }, transaction: t });
var themename=u.themename;
if(themename && themename=="policy"){
role = await self.roleDao.model.findOne({ where: { code: "policy" }, transaction: t });
}
if (role) { if (role) {
await result.setRoles([role], { transaction: t }); await result.setRoles([role], { transaction: t });
} }
} }
} else { }
var role = await this.roleDao.model.findOne({ where: { code: "guest", company_id: result.company_id }, transaction: t });
if (role) {
await result.setRoles([role], { transaction: t });
}
}
return result; return result;
} }
async create(qobj) { async create(qobj) {
......
<div id="bychpage" class="login" v-if="companyinfo.company.siteTheme == \'policy\'"> <div id="bychpage" class="login">
<div style="width:100%;margin: 0 auto;"> <div style="width:100%;margin: 0 auto;">
<div style="z-index:1;position:relative;background-color:#31373b"> <div style="z-index:1;position:relative;background-color:#31373b">
<img style="width:100%;height:auto" :src="loginUrl" /> <img style="width:100%;height:auto" :src="loginUrl" />
<div class="login-title" v-if="companyinfo.company.siteTheme == \'policy\'"> <div class="login-title" v-if="companyinfo.company.siteTheme == \'policy\'">
<span class="tong">政企通</span> <span class="tong">政企通</span>
<span class="shujuzi">政策大数据服务平台</span> <span class="shujuzi">政策大数据服务平台</span>
</div> </div>
<div class="login-div" v-if="a"> <div class="login-div" v-if="a">
<div class="login-content" style="width: 380px; <div class="login-content" style="width: 380px;
height: 508px; height: 508px;
background: rgba(255,255,255,1); background: rgba(255,255,255,1);
border: 1px solid rgba(151,151,151,1);"> border: 1px solid rgba(151,151,151,1);">
<div class="logins-title"> <div class="logins-title">
欢迎注册政企通账号 欢迎注册
</div> </div>
<!-- 验证码登录 --> <!-- 验证码登录 -->
<div v-if="activeIndex==1" class="login-content-inputs"> <div v-if="activeIndex==1" class="login-content-inputs">
<el-form ref="form1" :rules="rules1" :model="form1" label-width="0px" key="1"> <el-form ref="form1" :rules="rules1" :model="form1" label-width="0px" key="1">
<el-form-item prop="username"> <el-form-item>
<el-input v-model="form2.username" placeholder="请输入企业名称"> <i slot="prefix" <el-input v-model="form1.username" placeholder="请输入企业名称"> <i slot="prefix" class="el-input__icon el-icon-tickets"></i></el-input>
class="el-input__icon el-icon-tickets"></i></el-input> </el-form-item>
</el-form-item>
<el-form-item prop="mobile"> <el-form-item prop="mobile">
<el-input v-model="form1.mobile" placeholder="请输入11位手机号码"><i slot="prefix" <el-input v-model="form1.mobile" placeholder="请输入11位手机号码"><i slot="prefix" class="el-input__icon el-icon-mobile-phone"></i></el-input>
class="el-input__icon el-icon-mobile-phone"></i></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input type="password" v-model="form2.password" placeholder="请输入登录密码"><i slot="prefix" <el-input type="password" v-model="form1.password" placeholder="请输入登录密码"><i slot="prefix" class="el-input__icon el-icon-view"></i></el-input>
class="el-input__icon el-icon-view"></i></el-input> </el-form-item>
</el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<el-input style="width:175px;" v-model="form1.code" placeholder="请输入验证码"><i slot="prefix" <el-input style="width:175px;" v-model="form1.code" placeholder="请输入验证码"><i slot="prefix" class="el-input__icon el-icon-edit"></i></el-input>
class="el-input__icon el-icon-edit"></i></el-input>
<el-button id="loginCode" type="primary" plain style="width:135px;background: rgba(18,142,233,1); <el-button id="loginCode" type="primary" plain style="width:135px;background: rgba(18,142,233,1);
color: rgba(255,255,255,1);" @click="obtaincode1"> color: rgba(255,255,255,1);"
@click="obtaincode1">
获取验证码</el-button> 获取验证码</el-button>
</el-form-item> </el-form-item>
<div class="zhanghao">已有账号? <div class="zhanghao">已有账号?
<span style="color:#108EE9;cursor:pointer" @click="login">立即登录</span> <span style="color:#108EE9;cursor:pointer" @click="login">立即登录</span>
</div> </div>
<el-form-item style="margin-bottom:8px;"> <el-form-item style="margin-bottom:8px;">
<el-button type="primary" class="login-content-button" @click="checklogin1" style="margin-top: 45px;"> <el-button type="primary" class="login-content-button" @click="checklogin1" style="margin-top: 45px;">注 册</el-button>
</el-button>
</el-form-item> </el-form-item>
<div style="font-size: 12px; <div style="font-size: 12px;
color: rgb(130, 130, 130); color: rgb(130, 130, 130);
margin-left: 100px;">登录即同意 margin-left: 100px;">登录即同意
<span style="color:#108EE9">《服务协议》</span> <span style="color:#108EE9">《服务协议》</span>
</div> </div>
</el-form> </el-form>
...@@ -88,8 +84,8 @@ ...@@ -88,8 +84,8 @@
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<el-input style="width:120px;" v-model="form3.code" placeholder="请输入验证码"></el-input> <el-input style="width:120px;" v-model="form3.code" placeholder="请输入验证码"></el-input>
<el-button id="resetCode" type="primary" plain style="width:135px;" @click="obtaincode2">获取验证码 <el-button id="resetCode" type="primary" plain style="width:135px;"submitregister
</el-button> @click="obtaincode2">获取验证码</el-button>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input type="password" v-model="form3.password" placeholder="请设置6-18位密码"></el-input> <el-input type="password" v-model="form3.password" placeholder="请设置6-18位密码"></el-input>
...@@ -118,8 +114,8 @@ ...@@ -118,8 +114,8 @@
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<el-input style="width:120px;" v-model="form4.code" placeholder="请输入验证码"></el-input> <el-input style="width:120px;" v-model="form4.code" placeholder="请输入验证码"></el-input>
<el-button id="registerCode" type="primary" plain style="width:135px;" @click="obtaincode3">获取验证码 <el-button id="registerCode" type="primary" plain style="width:135px;"
</el-button> @click="obtaincode3">获取验证码</el-button>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input type="password" v-model="form4.password" placeholder="请设置6-18位密码,区分大小写"></el-input> <el-input type="password" v-model="form4.password" placeholder="请设置6-18位密码,区分大小写"></el-input>
...@@ -140,17 +136,13 @@ ...@@ -140,17 +136,13 @@
</div> </div>
</div> </div>
</div> </div>
<gsb-pcpage v-else>
<div style="padding-bottom:20px"> <!-- <gsb-pcpage style="text-align:center;margin-top:80px">
<!-- <el-radio-group v-model="actname" @change="rdochange"> <div>
<el-radio label="person">个人用户注册</el-radio> <gsb-form style="width:30%;margin: auto;" ref="loginFrm" :metaData="ldms" :refvalidatemethod="validmethod">
<el-radio label="ent">企业用户注册</el-radio> <h2 slot="title" style="margin:0px;padding-top: 20px">欢迎登录{{ this.$root.currentCompany?this.$root.currentCompany.sitename:"知圈圈"}}</h2>
</el-radio-group> --> <el-button slot="buttonarea" style="width:80%" type="primary" @click="sbhandler">登录</el-button>
<div style="border-bottom:solid 1px #eee;margin-top:20px;margin-bottom:15px"></div> </gsb-form>
<gsb-form key="pregisterFrm" style="width:50%;margin: auto;" ref="pregisterFrm" @btnclick="btnclick" :metaData="mds" </div>
:refvalidatemethod="validmethod"> </gsb-pcpage> -->
<h2 slot="title">欢迎注册{{ this.$root.currentCompany?this.$root.currentCompany.sitename:"知圈圈"}}</h2>
<el-button slot="buttonarea" type="primary" style="width:60%" @click="sbhandler">提交</el-button>
</gsb-form>
</div>
</gsb-pcpage>
\ No newline at end of file
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