Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
6c4597bc
Commit
6c4597bc
authored
Dec 05, 2019
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
9337228e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
440 additions
and
734 deletions
+440
-734
igirl-web/app/base/controller/impl/userCtl.js
+4
-1
igirl-web/app/base/service/impl/userSve.js
+5
-6
igirl-web/app/front/vues/pages/register/register.html
+36
-45
igirl-web/app/front/vues/pages/register/register.js
+395
-682
No files found.
igirl-web/app/base/controller/impl/userCtl.js
View file @
6c4597bc
...
...
@@ -275,13 +275,16 @@ class UserCtl extends CtlBase {
return
{
status
:
1
,
msg
:
"用户已存在, 请修改并重试"
};
}
else
{
obj
.
password
=
super
.
encryptPasswd
(
obj
.
password
);
var
company
=
await
this
.
companyS
.
findById
(
req
.
companyid
);
var
params
=
{
userName
:
obj
.
mobile
,
nickName
:
obj
.
mobile
,
mobile
:
obj
.
mobile
,
password
:
obj
.
password
,
company_id
:
req
.
companyid
company_id
:
req
.
companyid
,
themename
:
company
.
siteTheme
};
var
result
=
await
this
.
service
.
create
(
params
);
return
system
.
getResult2
(
result
);
}
...
...
igirl-web/app/base/service/impl/userSve.js
View file @
6c4597bc
...
...
@@ -17,16 +17,15 @@ class UserService extends ServiceBase {
await
result
.
setRoles
(
roles
,
{
transaction
:
t
});
}
else
{
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
)
{
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
;
}
async
create
(
qobj
)
{
...
...
igirl-web/app/front/vues/pages/register/register.html
View file @
6c4597bc
<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=
"z-index:1;position:relative;background-color:#31373b"
>
<img
style=
"width:100%;height:auto"
:src=
"loginUrl"
/>
<div
class=
"login-title"
v-if=
"companyinfo.company.siteTheme == \'policy\'"
>
<span
class=
"tong"
>
政企通
</span>
<span
class=
"shujuzi"
>
政策大数据服务平台
</span>
</div>
<span
class=
"tong"
>
政企通
</span>
<span
class=
"shujuzi"
>
政策大数据服务平台
</span>
</div>
<div
class=
"login-div"
v-if=
"a"
>
<div
class=
"login-content"
style=
"width: 380px;
height: 508px;
background: rgba(255,255,255,1);
border: 1px solid rgba(151,151,151,1);"
>
height: 508px;
background: rgba(255,255,255,1);
border: 1px solid rgba(151,151,151,1);"
>
<div
class=
"logins-title"
>
欢迎注册政企通账号
欢迎注册政企通账号
</div>
<!-- 验证码登录 -->
<div
v-if=
"activeIndex==1"
class=
"login-content-inputs"
>
<el-form
ref=
"form1"
:rules=
"rules1"
:model=
"form1"
label-width=
"0px"
key=
"1"
>
<el-form-item
prop=
"username"
>
<el-input
v-model=
"form2.username"
placeholder=
"请输入企业名称"
>
<i
slot=
"prefix"
class=
"el-input__icon el-icon-tickets"
></i></el-input>
</el-form-item>
<el-form-item
prop=
"username"
>
<el-input
v-model=
"form2.username"
placeholder=
"请输入企业名称"
>
<i
slot=
"prefix"
class=
"el-input__icon el-icon-tickets"
></i></el-input>
</el-form-item>
<el-form-item
prop=
"mobile"
>
<el-input
v-model=
"form1.mobile"
placeholder=
"请输入11位手机号码"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-mobile-phone"
></i></el-input>
<el-input
v-model=
"form1.mobile"
placeholder=
"请输入11位手机号码"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-mobile-phone"
></i></el-input>
</el-form-item>
<el-form-item
prop=
"password"
>
<el-input
type=
"password"
v-model=
"form2.password"
placeholder=
"请输入登录密码"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-view"
></i></el-input>
</el-form-item>
<el-input
type=
"password"
v-model=
"form2.password"
placeholder=
"请输入登录密码"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-view"
></i></el-input>
</el-form-item>
<el-form-item
prop=
"code"
>
<el-input
style=
"width:175px;"
v-model=
"form1.code"
placeholder=
"请输入验证码"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-edit"
></i></el-input>
<el-input
style=
"width:175px;"
v-model=
"form1.code"
placeholder=
"请输入验证码"
><i
slot=
"prefix"
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);
color: rgba(255,255,255,1);"
@
click=
"obtaincode1"
>
color: rgba(255,255,255,1);"
@
click=
"obtaincode1"
>
获取验证码
</el-button>
</el-form-item>
<div
class=
"zhanghao"
>
已有账号?
<span
style=
"color:#108EE9;cursor:pointer"
@
click=
"login"
>
立即登录
</span>
</div>
<span
style=
"color:#108EE9;cursor:pointer"
@
click=
"login"
>
立即登录
</span>
</div>
<el-form-item
style=
"margin-bottom:8px;"
>
<el-button
type=
"primary"
class=
"login-content-button"
@
click=
"checklogin1"
style=
"margin-top: 45px;"
>
注
册
</el-button>
<el-button
type=
"primary"
class=
"login-content-button"
@
click=
"checklogin1"
style=
"margin-top: 45px;"
>
注 册
</el-button>
</el-form-item>
<div
style=
"font-size: 12px;
color: rgb(130, 130, 130);
margin-left: 100px;"
>
登录即同意
color: rgb(130, 130, 130);
margin-left: 100px;"
>
登录即同意
<span
style=
"color:#108EE9"
>
《服务协议》
</span>
</div>
</el-form>
...
...
@@ -88,8 +84,8 @@
</el-form-item>
<el-form-item
prop=
"code"
>
<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>
<el-button
id=
"resetCode"
type=
"primary"
plain
style=
"width:135px;"
@
click=
"obtaincode2"
>
获取验证码
</el-button>
</el-form-item>
<el-form-item
prop=
"password"
>
<el-input
type=
"password"
v-model=
"form3.password"
placeholder=
"请设置6-18位密码"
></el-input>
...
...
@@ -118,8 +114,8 @@
</el-form-item>
<el-form-item
prop=
"code"
>
<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>
<el-button
id=
"registerCode"
type=
"primary"
plain
style=
"width:135px;"
@
click=
"obtaincode3"
>
获取验证码
</el-button>
</el-form-item>
<el-form-item
prop=
"password"
>
<el-input
type=
"password"
v-model=
"form4.password"
placeholder=
"请设置6-18位密码,区分大小写"
></el-input>
...
...
@@ -140,17 +136,13 @@
</div>
</div>
</div>
<gsb-pcpage
v-else
>
<div
style=
"padding-bottom:20px"
>
<!-- <el-radio-group v-model="actname" @change="rdochange">
<el-radio label="person">个人用户注册</el-radio>
<el-radio label="ent">企业用户注册</el-radio>
</el-radio-group> -->
<div
style=
"border-bottom:solid 1px #eee;margin-top:20px;margin-bottom:15px"
></div>
<gsb-form
key=
"pregisterFrm"
style=
"width:50%;margin: auto;"
ref=
"pregisterFrm"
@
btnclick=
"btnclick"
:metaData=
"mds"
:refvalidatemethod=
"validmethod"
>
<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
<!-- <gsb-pcpage style="text-align:center;margin-top:80px">
<div>
<gsb-form style="width:30%;margin: auto;" ref="loginFrm" :metaData="ldms" :refvalidatemethod="validmethod">
<h2 slot="title" style="margin:0px;padding-top: 20px">欢迎登录{{ this.$root.currentCompany?this.$root.currentCompany.sitename:"知圈圈"}}</h2>
<el-button slot="buttonarea" style="width:80%" type="primary" @click="sbhandler">登录</el-button>
</gsb-form>
</div>
</gsb-pcpage> -->
igirl-web/app/front/vues/pages/register/register.js
View file @
6c4597bc
{
template
:
'${tmpl}'
,
data
:
function
(){
var
that
=
this
;
var
validateMethod
=
function
(
rule
,
value
,
callback
){
console
.
log
(
rule
);
if
(
rule
.
field
==
"mobile"
){
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
value
)
==
false
){
return
callback
(
new
Error
(
"请输入正确格式的手机号"
));
}
else
{
return
callback
();
}
template
:
'${tmpl}'
,
data
:
function
(){
var
that
=
this
;
var
validateMethod
=
function
(
rule
,
value
,
callback
){
console
.
log
(
rule
);
if
(
rule
.
field
==
"mobile"
){
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
value
)
==
false
){
return
callback
(
new
Error
(
"请输入正确格式的手机号"
));
}
else
{
return
callback
();
}
if
(
rule
.
field
==
"code"
){
if
(
that
.
rcode
!=
value
){
return
callback
(
new
Error
(
"输入验证码有误,请重新输入"
));
}
}
if
(
rule
.
field
==
"code"
){
if
(
that
.
rcode
!=
value
){
return
callback
(
new
Error
(
"输入验证码有误,请重新输入"
));
}
return
callback
();
};
return
{
mds
:[],
emds
:[],
vcode
:
""
,
actname
:
"person"
,
currentFrm
:
null
,
ldms
:[],
activeIndex
:
"1"
,
loginUrl
:
""
,
form1
:{
mobile
:
""
,
code
:
""
,
},
form2
:{
username
:
""
,
password
:
""
,
},
form3
:{
mobile
:
""
,
code
:
""
,
password
:
""
,
},
form4
:{
mobile
:
""
,
code
:
""
,
password
:
""
,
},
a
:
true
,
b
:
false
,
c
:
false
,
Num
:
60
,
Num2
:
60
,
Num3
:
60
,
rcode
:
""
,
rules1
:{
username
:
[
{
required
:
true
,
message
:
'请输入账号'
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
],
mobile
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
code
:
[
{
required
:
true
,
message
:
'请输入手机接收到的验证码'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
},
rules2
:{
username
:
[
{
required
:
true
,
message
:
'请输入账号'
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
],
},
rules3
:{
mobile
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
code
:
[
{
required
:
true
,
message
:
'请输入手机接收到的验证码'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
{
min
:
6
,
max
:
18
,
message
:
'长度在 6 到 18 个字符'
,
trigger
:
'blur'
}
],
},
rules4
:{
mobile
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
code
:
[
{
required
:
true
,
message
:
'请输入手机接收到的验证码'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
{
min
:
6
,
max
:
18
,
message
:
'长度在 6 到 18 个字符'
,
trigger
:
'blur'
}
],
},
}
},
mounted
:
function
(){
this
.
mds
=
[
{
"title"
:
"用户名"
,
"validProp"
:
"userName"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入用户名'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"userName"
,
"placeHolder"
:
"请输入用户名"
,
"style"
:
""
},
]
}
return
callback
();
};
return
{
ldms
:[],
activeIndex
:
"1"
,
loginUrl
:
""
,
form1
:{
mobile
:
""
,
code
:
""
,
},
form2
:{
username
:
""
,
password
:
""
,
},
{
"title"
:
"用户密码"
,
"validProp"
:
"password"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入用户密码'
,
"trigger"
:
'blur'
},
],
ctls
:[
{
"type"
:
"input"
,
"label"
:
"用户密码"
,
"prop"
:
"password"
,
"placeHolder"
:
"请输入用户密码"
,
"style"
:
""
},
]
form3
:{
mobile
:
""
,
code
:
""
,
password
:
""
,
},
{
"title"
:
"确认密码"
,
"validProp"
:
"cfmpwd"
,
"rule"
:
[
{
"validator"
:
"validatex"
,
"trigger"
:
'blur'
},
{
"required"
:
true
,
"message"
:
'请输入确认密码'
,
"trigger"
:
'blur'
},
],
ctls
:[
{
"type"
:
"input"
,
"label"
:
"确认密码"
,
"prop"
:
"cfmpwd"
,
"placeHolder"
:
"请输入确认密码"
,
"style"
:
""
},
]
form4
:{
mobile
:
""
,
code
:
""
,
password
:
""
,
},
{
"title"
:
"姓名"
,
"validProp"
:
"nickName"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入姓名'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"nickName"
,
"placeHolder"
:
"请输入姓名"
,
"style"
:
""
},
]
a
:
true
,
b
:
false
,
c
:
false
,
Num
:
60
,
Num2
:
60
,
Num3
:
60
,
rcode
:
""
,
rules1
:{
username
:
[
{
required
:
true
,
message
:
'请输入账号'
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
],
mobile
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
code
:
[
{
required
:
true
,
message
:
'请输入手机接收到的验证码'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
},
{
"title"
:
"手机号"
,
"validProp"
:
"mobile"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入手机号'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"手机号"
,
"prop"
:
"mobile"
,
"placeHolder"
:
"请输入手机号"
,
"style"
:
""
},
{
"type"
:
"btn"
,
"label"
:
"获取验证码"
,
"prop"
:
"vcodeget"
,
"placeHolder"
:
"请输入手机号"
,
"style"
:{
"margin-left"
:
"8px"
},
"face"
:
"primary"
},
]
rules2
:{
username
:
[
{
required
:
true
,
message
:
'请输入账号'
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
],
},
{
"title"
:
"验证码"
,
"validProp"
:
"vcode"
,
"rule"
:
[
{
"validator"
:
"validatex"
,
"trigger"
:
'blur'
},
{
"required"
:
true
,
"message"
:
'请输入验证码'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"手机号"
,
"prop"
:
"vcode"
,
"placeHolder"
:
"请输入收到的手机验证码"
,
"style"
:
""
},
]
},
{
"title"
:
"身份证号"
,
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"onlyCode"
,
"placeHolder"
:
"请输入身份证号"
,
"style"
:
""
},
]
rules3
:{
mobile
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
code
:
[
{
required
:
true
,
message
:
'请输入手机接收到的验证码'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
{
min
:
6
,
max
:
18
,
message
:
'长度在 6 到 18 个字符'
,
trigger
:
'blur'
}
],
},
rules4
:{
mobile
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
code
:
[
{
required
:
true
,
message
:
'请输入手机接收到的验证码'
,
trigger
:
'blur'
},
{
validator
:
validateMethod
,
trigger
:
'blur'
},
],
password
:
[
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
{
min
:
6
,
max
:
18
,
message
:
'长度在 6 到 18 个字符'
,
trigger
:
'blur'
}
],
},
];
this
.
currentFrm
=
this
.
$refs
.
pregisterFrm
;
},
created
:
function
(){
console
.
log
(
this
.
pfooterinfo
);
if
(
this
.
pfooterinfo
&&
this
.
pfooterinfo
.
loginUrl
){
this
.
loginUrl
=
this
.
pfooterinfo
.
loginUrl
;
}
else
{
this
.
loginUrl
=
"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_41110157500594182420192913391824zhuce_background.png"
;
}
},
methods
:{
rdochange
:
function
(
nv
){
if
(
nv
==
"person"
){
this
.
mds
=
[
{
"title"
:
"用户名"
,
"validProp"
:
"userName"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入用户名'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"userName"
,
"placeHolder"
:
"请输入用户名"
,
"style"
:
""
},
]
},
{
"title"
:
"用户密码"
,
"validProp"
:
"password"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入用户密码'
,
"trigger"
:
'blur'
},
],
ctls
:[
{
"type"
:
"input"
,
"label"
:
"用户密码"
,
"prop"
:
"password"
,
"placeHolder"
:
"请输入用户密码"
,
"style"
:
""
},
]
},
{
"title"
:
"确认密码"
,
"validProp"
:
"cfmpwd"
,
"rule"
:
[
{
"validator"
:
"validatex"
,
"trigger"
:
'blur'
},
{
"required"
:
true
,
"message"
:
'请输入确认密码'
,
"trigger"
:
'blur'
},
],
ctls
:[
{
"type"
:
"input"
,
"label"
:
"确认密码"
,
"prop"
:
"cfmpwd"
,
"placeHolder"
:
"请输入确认密码"
,
"style"
:
""
},
]
},
{
"title"
:
"姓名"
,
"validProp"
:
"nickName"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入姓名'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"nickName"
,
"placeHolder"
:
"请输入姓名"
,
"style"
:
""
},
]
},
{
"title"
:
"手机号"
,
"validProp"
:
"mobile"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入手机号'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"手机号"
,
"prop"
:
"mobile"
,
"placeHolder"
:
"请输入手机号"
,
"style"
:
""
},
{
"type"
:
"btn"
,
"label"
:
"获取验证码"
,
"prop"
:
"vcodeget"
,
"placeHolder"
:
"请输入手机号"
,
"style"
:{
"margin-left"
:
"8px"
},
"face"
:
"primary"
},
]
},
{
"title"
:
"验证码"
,
"validProp"
:
"vcode"
,
"rule"
:
[
{
"validator"
:
"validatex"
,
"trigger"
:
'blur'
},
{
"required"
:
true
,
"message"
:
'请输入验证码'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"手机号"
,
"prop"
:
"vcode"
,
"placeHolder"
:
"请输入收到的手机验证码"
,
"style"
:
""
},
]
},
{
"title"
:
"身份证号"
,
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"onlyCode"
,
"placeHolder"
:
"请输入身份证号"
,
"style"
:
""
},
]
},
];
this
.
currentFrm
=
this
.
$refs
.
pregisterFrm
;
}
else
{
this
.
emds
=
[
{
"title"
:
"用户名"
,
"validProp"
:
"userName"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入用户名'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"userName"
,
"placeHolder"
:
"请输入用户名"
,
"style"
:
""
},
]
},
{
"title"
:
"用户密码"
,
"validProp"
:
"password"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入用户密码'
,
"trigger"
:
'blur'
},
],
ctls
:[
{
"type"
:
"input"
,
"label"
:
"用户密码"
,
"prop"
:
"password"
,
"placeHolder"
:
"请输入用户密码"
,
"style"
:
""
},
]
},
{
"title"
:
"确认密码"
,
"validProp"
:
"cfmpwd"
,
"rule"
:
[
{
"validator"
:
"validatex"
,
"trigger"
:
'blur'
},
{
"required"
:
true
,
"message"
:
'请输入确认密码'
,
"trigger"
:
'blur'
},
],
ctls
:[
{
"type"
:
"input"
,
"label"
:
"确认密码"
,
"prop"
:
"cfmpwd"
,
"placeHolder"
:
"请输入确认密码"
,
"style"
:
""
},
]
},
{
"title"
:
"企业名称"
,
"validProp"
:
"companyName"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入企业名称'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"companyName"
,
"placeHolder"
:
"请输入企业名称"
,
"style"
:
""
},
]
},
{
"title"
:
"联系人"
,
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"用户名"
,
"prop"
:
"nickName"
,
"placeHolder"
:
"请输入联系人姓名"
,
"style"
:
""
},
]
},
{
"title"
:
"手机号"
,
"validProp"
:
"mobile"
,
"rule"
:
[
{
"required"
:
true
,
"message"
:
'请输入手机号'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"手机号"
,
"prop"
:
"mobile"
,
"placeHolder"
:
"请输入手机号"
,
"style"
:
""
},
{
"type"
:
"btn"
,
"label"
:
"获取验证码"
,
"prop"
:
"vcodeget"
,
"placeHolder"
:
"请输入手机号"
,
"style"
:{
"margin-left"
:
"8px"
},
"face"
:
"primary"
},
]
},
{
"title"
:
"验证码"
,
"validProp"
:
"vcode"
,
"rule"
:
[
{
"validator"
:
"validatex"
,
"trigger"
:
'blur'
},
{
"required"
:
true
,
"message"
:
'请输入验证码'
,
"trigger"
:
'blur'
},
],
"ctls"
:[
{
"type"
:
"input"
,
"label"
:
"手机号"
,
"prop"
:
"vcode"
,
"placeHolder"
:
"请输入收到的手机验证码"
,
"style"
:
""
},
]
},
];
this
.
currentFrm
=
this
.
$refs
.
eregisterFrm
;
}
},
validmethod
:
function
(
rule
,
value
,
callback
)
{
console
.
log
(
"code validdate"
);
var
self
=
this
;
var
fm
=
this
.
currentFrm
.
getFormModel
();
if
(
rule
.
field
==
"cfmpwd"
){
if
(
fm
.
password
!=
value
){
return
callback
(
new
Error
(
"两次输入的密码不一致,请重新输入!"
));
}
}
if
(
rule
.
field
==
"vcode"
){
if
(
self
.
vcode
!=
value
){
return
callback
(
new
Error
(
"验证码输入错误,请重新输入或重新获取后输入!"
));
}
}
return
callback
();
},
sbhandler
:
function
()
{
var
self
=
this
;
var
fm
=
this
.
currentFrm
.
getFormModel
();
this
.
currentFrm
.
validate
(
function
(
v
){
if
(
v
){
self
.
$root
.
postReq
(
"/web/userCtl/register"
,{
u
:
fm
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
self
.
$root
.
removetab
(
"/register"
);
self
.
$root
.
pushx
({
title
:
"登录"
,
name
:
"/login"
});
}
});
}
});
},
btnclick
:
function
(
pfm
,
code
){
var
fm
=
pfm
;
if
(
code
==
"vcodeget"
){
var
that
=
this
;
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
fm
.
mobile
)
==
false
){
this
.
$alert
(
'请输入正确格式的手机号码'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
});
return
;
}
this
.
$root
.
showMask
();
/*ajax 调用获取手机验证码,并存储到*/
this
.
$root
.
postReq
(
"/web/userCtl/fetchVcode"
,{
mobile
:
fm
.
mobile
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
vcode
=
d
.
data
.
vcodestr
;
setTimeout
(()
=>
{
that
.
$root
.
hideMask
();
},
3000
);
}
});
}
},
handleSelect
(
key
,
keyPath
)
{
console
.
log
(
key
,
keyPath
);
this
.
activeIndex
=
key
;
},
resetall
(){
this
.
form1
.
mobile
=
""
;
this
.
form1
.
code
=
""
;
this
.
form2
.
username
=
""
;
this
.
form2
.
password
=
""
;
this
.
form3
.
mobile
=
""
;
this
.
form3
.
code
=
""
;
this
.
form3
.
password
=
""
;
this
.
form4
.
mobile
=
""
;
this
.
form4
.
code
=
""
;
this
.
form4
.
password
=
""
;
},
rsetpassword
(){
this
.
a
=
false
;
this
.
b
=
true
;
this
.
c
=
false
;
this
.
rcode
=
""
;
this
.
resetall
();
},
login
(){
this
.
$root
.
pushx
({
title
:
"登录"
,
name
:
"/login"
});
this
.
a
=
true
;
this
.
b
=
false
;
},
mounted
:
function
(){
},
created
:
function
(){
console
.
log
(
this
.
pfooterinfo
);
if
(
this
.
pfooterinfo
&&
this
.
pfooterinfo
.
loginUrl
){
this
.
loginUrl
=
this
.
pfooterinfo
.
loginUrl
;
}
else
{
this
.
loginUrl
=
"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_41110157500594182420192913391824zhuce_background.png"
;
}
},
methods
:{
handleSelect
(
key
,
keyPath
)
{
console
.
log
(
key
,
keyPath
);
this
.
activeIndex
=
key
;
},
resetall
(){
this
.
form1
.
mobile
=
""
;
this
.
form1
.
code
=
""
;
this
.
form2
.
username
=
""
;
this
.
form2
.
password
=
""
;
this
.
form3
.
mobile
=
""
;
this
.
form3
.
code
=
""
;
this
.
form3
.
password
=
""
;
this
.
form4
.
mobile
=
""
;
this
.
form4
.
code
=
""
;
this
.
form4
.
password
=
""
;
},
rsetpassword
(){
this
.
a
=
false
;
this
.
b
=
true
;
this
.
c
=
false
;
this
.
rcode
=
""
;
this
.
resetall
();
},
register
(){
this
.
a
=
false
;
this
.
b
=
false
;
this
.
c
=
true
;
this
.
rcode
=
""
;
this
.
resetall
();
},
obtaincode1
(){
this
.
fetchVcode
(
this
.
form1
.
mobile
)
},
obtaincode2
(){
var
that
=
this
;
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
that
.
form3
.
mobile
)
==
false
){
that
.
$alert
(
'请输入正确格式的手机号码'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
});
return
;
};
that
.
$root
.
postReq
(
"/web/userCtl/getUserByMobile"
,{
mobile
:
that
.
form3
.
mobile
}).
then
(
function
(
d
){
if
(
d
.
code
==
0
){
var
timer
=
setInterval
(
function
()
{
console
.
log
(
"----------getNumber-----------"
);
$
(
"#resetCode"
).
attr
(
"disabled"
,
"disabled"
);
$
(
"#resetCode"
).
css
(
"cursor"
,
"not-allowed"
);
$
(
"#resetCode"
).
text
(
that
.
Num2
+
"秒后重新获取"
);
},
login
(){
this
.
$root
.
pushx
({
title
:
"登录"
,
name
:
"/login"
});
this
.
a
=
true
;
this
.
b
=
false
;
this
.
c
=
false
;
this
.
rcode
=
""
;
this
.
resetall
();
},
register
(){
this
.
a
=
false
;
this
.
b
=
false
;
this
.
c
=
true
;
this
.
rcode
=
""
;
this
.
resetall
();
},
obtaincode1
(){
this
.
fetchVcode
(
this
.
form1
.
mobile
)
},
obtaincode2
(){
var
that
=
this
;
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
that
.
form3
.
mobile
)
==
false
){
that
.
$alert
(
'请输入正确格式的手机号码'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
});
return
;
};
that
.
$root
.
postReq
(
"/web/userCtl/getUserByMobile"
,{
mobile
:
that
.
form3
.
mobile
}).
then
(
function
(
d
){
if
(
d
.
code
==
0
){
var
timer
=
setInterval
(
function
()
{
console
.
log
(
"----------getNumber-----------"
);
$
(
"#resetCode"
).
attr
(
"disabled"
,
"disabled"
);
$
(
"#resetCode"
).
css
(
"cursor"
,
"not-allowed"
);
$
(
"#resetCode"
).
text
(
that
.
Num2
+
"秒后重新获取"
);
console
.
log
(
that
.
Num2
);
if
(
that
.
Num2
>
0
)
{
console
.
log
(
that
.
Num2
);
if
(
that
.
Num2
>
0
)
{
console
.
log
(
that
.
Num2
);
that
.
Num2
--
;
}
else
{
$
(
"#resetCode"
).
attr
(
"disabled"
,
false
)
;
$
(
"#resetCode"
).
text
(
"获取验证码"
);
that
.
Num2
=
60
;
clearInterval
(
timer
);
}
},
1000
);
that
.
$root
.
postReq
(
"/web/userCtl/fetchVcode"
,{
mobile
:
that
.
form3
.
mobile
}).
then
(
function
(
d
){
console
.
log
(
d
)
;
if
(
d
.
status
==
0
){
that
.
rcode
=
d
.
data
.
vcodestr
;
}
})
}
else
{
that
.
$message
({
type
:
'error'
,
message
:
'用户尚未注册'
});
}
})
},
obtaincode3
(
){
var
that
=
this
;
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
that
.
form4
.
mobile
)
==
false
){
that
.
$alert
(
'请输入正确格式的手机号码'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
})
;
return
;
};
that
.
$root
.
postReq
(
"/web/userCtl/getUserByMobile"
,{
mobile
:
that
.
form4
.
mobile
}).
then
(
function
(
d
)
{
if
(
d
.
code
==-
1
){
var
timer
=
setInterval
(
function
()
{
console
.
log
(
"----------getNumber-----------
"
);
$
(
"#registerCode"
).
attr
(
"disabled"
,
"disabled
"
);
$
(
"#registerCode"
).
css
(
"cursor"
,
"not-allowed"
);
$
(
"#registerCode"
).
text
(
that
.
Num3
+
"秒后重新获取"
);
that
.
Num2
--
;
}
else
{
$
(
"#resetCode"
).
attr
(
"disabled"
,
false
)
;
$
(
"#resetCode"
).
text
(
"获取验证码"
);
that
.
Num2
=
60
;
clearInterval
(
timer
);
}
},
1000
);
that
.
$root
.
postReq
(
"/web/userCtl/fetchVcode"
,{
mobile
:
that
.
form3
.
mobile
}).
then
(
function
(
d
){
console
.
log
(
d
);
if
(
d
.
status
==
0
){
that
.
rcode
=
d
.
data
.
vcodestr
;
}
})
}
else
{
that
.
$message
({
type
:
'error'
,
message
:
'用户尚未注册'
});
}
})
},
obtaincode3
(){
var
that
=
this
;
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
that
.
form4
.
mobile
)
==
false
){
that
.
$alert
(
'请输入正确格式的手机号码'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
});
return
;
}
;
that
.
$root
.
postReq
(
"/web/userCtl/getUserByMobile"
,{
mobile
:
that
.
form4
.
mobile
}).
then
(
function
(
d
){
if
(
d
.
code
==-
1
){
var
timer
=
setInterval
(
function
()
{
console
.
log
(
"----------getNumber-----------"
);
$
(
"#registerCode"
).
attr
(
"disabled"
,
"disabled"
);
$
(
"#registerCode"
).
css
(
"cursor"
,
"not-allowed
"
);
$
(
"#registerCode"
).
text
(
that
.
Num3
+
"秒后重新获取
"
);
console
.
log
(
that
.
Num3
);
if
(
that
.
Num3
>
0
)
{
console
.
log
(
that
.
Num3
);
if
(
that
.
Num3
>
0
)
{
console
.
log
(
that
.
Num3
);
that
.
Num3
--
;
}
else
{
$
(
"#registerCode"
).
attr
(
"disabled"
,
false
);
$
(
"#registerCode"
).
text
(
"获取验证码"
);
that
.
Num3
=
60
;
clearInterval
(
timer
);
}
},
1000
);
that
.
$root
.
postReq
(
"/web/userCtl/fetchVcode"
,{
mobile
:
that
.
form4
.
mobile
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
console
.
log
(
d
);
that
.
rcode
=
d
.
data
.
vcodestr
;
}
})
}
else
{
that
.
$message
({
type
:
'error'
,
message
:
'用户已存在, 请修改并重试'
});
}
})
that
.
Num3
--
;
}
else
{
$
(
"#registerCode"
).
attr
(
"disabled"
,
false
);
$
(
"#registerCode"
).
text
(
"获取验证码"
);
that
.
Num3
=
60
;
clearInterval
(
timer
);
}
},
1000
);
that
.
$root
.
postReq
(
"/web/userCtl/fetchVcode"
,{
mobile
:
that
.
form4
.
mobile
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
console
.
log
(
d
);
that
.
rcode
=
d
.
data
.
vcodestr
;
}
})
}
else
{
that
.
$message
({
type
:
'error'
,
message
:
'用户已存在, 请修改并重试'
});
}
})
},
checklogin1
(){
var
that
=
this
;
var
obj
=
{
mobile
:
that
.
form1
.
mobile
,
};
that
.
$refs
.
form1
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/loginByMobile"
,{
u
:
obj
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
console
.
log
(
"..................................................helllo.................................."
);
that
.
$root
.
refreshLoginState
(()
=>
{
console
.
log
(
"....................................................................................innner"
);
var
afto
=
localStorage
.
getItem
(
"afterLogin"
);
if
(
afto
){
that
.
$root
.
pushx
(
JSON
.
parse
(
afto
));
localStorage
.
removeItem
(
"afterLogin"
);
that
.
$root
.
removetab
(
"/login"
);
}
else
{
location
.
reload
();
}
});
}
})
}
})
},
checklogin2
(){
var
that
=
this
;
var
obj
=
{
userName
:
that
.
form2
.
username
,
password
:
that
.
form2
.
password
};
that
.
$refs
.
form2
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/login"
,{
u
:
obj
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
$root
.
refreshLoginState
(()
=>
{
console
.
log
(
"....................................................................................innner"
);
var
afto
=
localStorage
.
getItem
(
"afterLogin"
);
if
(
afto
){
that
.
$root
.
pushx
(
JSON
.
parse
(
afto
));
localStorage
.
removeItem
(
"afterLogin"
);
that
.
$root
.
removetab
(
"/login"
);
}
else
{
location
.
reload
();
}
});
}
else
{
that
.
$message
({
type
:
'error'
,
message
:
'用户名或密码错误,请重试.'
});
}
})
}
});
},
sumbitreset
(){
var
that
=
this
;
var
obj
=
{
mobile
:
this
.
form3
.
mobile
,
password
:
this
.
form3
.
password
};
that
.
$refs
.
form3
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/resetPassword"
,
obj
).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
$message
({
type
:
'success'
,
message
:
'密码重置成功'
});
}
})
}
})
},
submitregister
(){
var
that
=
this
;
var
obj
=
{
mobile
:
this
.
form4
.
mobile
,
password
:
this
.
form4
.
password
};
that
.
$refs
.
form4
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/submitregister"
,
obj
).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
$message
({
type
:
'success'
,
message
:
'注册成功,请登录'
});
that
.
login
();
}
else
if
(
d
.
status
==
1
){
},
checklogin1
(){
var
that
=
this
;
var
obj
=
{
mobile
:
that
.
form1
.
mobile
,
};
that
.
$refs
.
form1
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/loginByMobile"
,{
u
:
obj
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
console
.
log
(
"..................................................helllo.................................."
);
that
.
$root
.
refreshLoginState
(()
=>
{
console
.
log
(
"....................................................................................innner"
);
var
afto
=
localStorage
.
getItem
(
"afterLogin"
);
if
(
afto
){
that
.
$root
.
pushx
(
JSON
.
parse
(
afto
));
localStorage
.
removeItem
(
"afterLogin"
);
that
.
$root
.
removetab
(
"/login"
);
}
else
{
location
.
reload
();
}
});
}
})
}
})
},
checklogin2
(){
var
that
=
this
;
var
obj
=
{
userName
:
that
.
form2
.
username
,
password
:
that
.
form2
.
password
};
that
.
$refs
.
form2
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/login"
,{
u
:
obj
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
$root
.
refreshLoginState
(()
=>
{
console
.
log
(
"....................................................................................innner"
);
var
afto
=
localStorage
.
getItem
(
"afterLogin"
);
if
(
afto
){
that
.
$root
.
pushx
(
JSON
.
parse
(
afto
));
localStorage
.
removeItem
(
"afterLogin"
);
that
.
$root
.
removetab
(
"/login"
);
}
else
{
location
.
reload
();
}
});
}
else
{
that
.
$message
({
type
:
'error'
,
message
:
'
该手机号码已注册
'
message
:
'
用户名或密码错误,请重试.
'
});
}
})
}
})
},
fetchVcode
(
mobilenum
){
var
that
=
this
;
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
mobilenum
)
==
false
){
this
.
$alert
(
'请输入正确格式的手机号码'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
});
return
;
};
var
timer
=
setInterval
(
function
()
{
console
.
log
(
"----------getNumber-----------"
);
$
(
"#loginCode"
).
attr
(
"disabled"
,
"disabled"
);
$
(
"#loginCode"
).
css
(
"cursor"
,
"not-allowed"
);
$
(
"#loginCode"
).
text
(
that
.
Num
+
"秒后重新获取"
);
}
})
}
});
},
sumbitreset
(){
var
that
=
this
;
var
obj
=
{
mobile
:
this
.
form3
.
mobile
,
password
:
this
.
form3
.
password
};
that
.
$refs
.
form3
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/resetPassword"
,
obj
).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
$message
({
type
:
'success'
,
message
:
'密码重置成功'
});
}
})
}
})
},
submitregister
(){
var
that
=
this
;
var
obj
=
{
mobile
:
this
.
form4
.
mobile
,
password
:
this
.
form4
.
password
};
that
.
$refs
.
form4
.
validate
(
valid
=>
{
if
(
valid
){
that
.
$root
.
postReq
(
"/web/userCtl/submitregister"
,
obj
).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
$message
({
type
:
'success'
,
message
:
'注册成功,请登录'
});
that
.
login
();
}
else
if
(
d
.
status
==
1
){
that
.
$message
({
type
:
'error'
,
message
:
'该手机号码已注册'
});
}
})
}
})
},
fetchVcode
(
mobilenum
){
var
that
=
this
;
if
(
/^1
[
23456789
]\d{9}
$/
.
test
(
mobilenum
)
==
false
){
this
.
$alert
(
'请输入正确格式的手机号码'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
});
return
;
};
var
timer
=
setInterval
(
function
()
{
console
.
log
(
"----------getNumber-----------"
);
$
(
"#loginCode"
).
attr
(
"disabled"
,
"disabled"
);
$
(
"#loginCode"
).
css
(
"cursor"
,
"not-allowed"
);
$
(
"#loginCode"
).
text
(
that
.
Num
+
"秒后重新获取"
);
console
.
log
(
that
.
Num
);
if
(
that
.
Num
>
0
)
{
console
.
log
(
that
.
Num
);
if
(
that
.
Num
>
0
)
{
console
.
log
(
that
.
Num
);
that
.
Num
--
;
}
else
{
$
(
"#loginCode"
).
attr
(
"disabled"
,
false
);
$
(
"#loginCode"
).
text
(
"获取验证码"
);
that
.
Num
=
60
;
clearInterval
(
timer
);
}
},
1000
);
this
.
$root
.
postReq
(
"/web/userCtl/fetchVcode"
,{
mobile
:
mobilenum
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
rcode
=
d
.
data
.
vcodestr
;
}
})
that
.
Num
--
;
}
else
{
$
(
"#loginCode"
).
attr
(
"disabled"
,
false
);
$
(
"#loginCode"
).
text
(
"获取验证码"
);
that
.
Num
=
60
;
clearInterval
(
timer
);
}
},
1000
);
this
.
$root
.
postReq
(
"/web/userCtl/fetchVcode"
,{
mobile
:
mobilenum
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
that
.
rcode
=
d
.
data
.
vcodestr
;
}
})
},
validmethod
:
function
(
rule
,
value
,
callback
)
{
console
.
log
(
"code validdate"
);
var
self
=
this
;
var
fm
=
this
.
currentFrm
.
getFormModel
();
return
callback
();
},
sbhandler
:
function
()
{
var
self
=
this
;
var
fm
=
this
.
$refs
.
loginFrm
.
getFormModel
();
this
.
$refs
.
loginFrm
.
validate
(
function
(
v
){
if
(
v
){
self
.
$root
.
postReq
(
"/web/userCtl/login"
,{
u
:
fm
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
console
.
log
(
"...................................................................................."
);
self
.
$root
.
refreshLoginState
(()
=>
{
console
.
log
(
"....................................................................................innner"
);
var
afto
=
localStorage
.
getItem
(
"afterLogin"
);
if
(
afto
){
self
.
$root
.
pushx
(
JSON
.
parse
(
afto
));
localStorage
.
removeItem
(
"afterLogin"
);
self
.
$root
.
removetab
(
"/login"
);
}
else
{
location
.
reload
();
}
},
validmethod
:
function
(
rule
,
value
,
callback
)
{
console
.
log
(
"code validdate"
);
var
self
=
this
;
var
fm
=
this
.
currentFrm
.
getFormModel
();
return
callback
();
},
sbhandler
:
function
()
{
var
self
=
this
;
var
fm
=
this
.
$refs
.
loginFrm
.
getFormModel
();
this
.
$refs
.
loginFrm
.
validate
(
function
(
v
){
if
(
v
){
self
.
$root
.
postReq
(
"/web/userCtl/login"
,{
u
:
fm
}).
then
(
function
(
d
){
if
(
d
.
status
==
0
){
console
.
log
(
"...................................................................................."
);
self
.
$root
.
refreshLoginState
(()
=>
{
console
.
log
(
"....................................................................................innner"
);
var
afto
=
localStorage
.
getItem
(
"afterLogin"
);
if
(
afto
){
self
.
$root
.
pushx
(
JSON
.
parse
(
afto
));
localStorage
.
removeItem
(
"afterLogin"
);
self
.
$root
.
removetab
(
"/login"
);
}
else
{
location
.
reload
();
}
});
}
else
{
self
.
$message
({
type
:
'error'
,
message
:
'用户名或密码错误,请重试.'
});
}
else
{
self
.
$message
({
type
:
'error'
,
message
:
'用户名或密码错误,请重试.'
});
}
});
}
});
},
}
});
}
});
},
},
vname
:
"gsb-login"
},
vname
:
"gsb-login"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment