Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
9 years ago
Commit
800e35b9bc4e08f25a6e7a2014d076ada28ff2b8
1 parent
c7594cf0
调整登录的代码。
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
42 deletions
apps/passport/controllers/login.js
apps/passport/views/action/bind/bind-set-pwd.hbs
public/js/passport/back/reset.js
public/js/passport/bind/third-pwd.js
apps/passport/controllers/login.js
View file @
800e35b
...
...
@@ -272,12 +272,12 @@ const qq = {
login
:
(
req
,
res
)
=>
{
let
authState
=
req
.
session
.
authState
=
uuid
.
v4
();
return
res
.
redirect
(
`
//www.yohobuy.com/passport/autosign/qq?type=yohoblk&state=${authState}`)
return
res
.
redirect
(
`
//www.yohobuy.com/passport/autosign/qq?type=yohoblk&state=${authState}`)
;
},
callback
:
(
req
,
res
,
next
)
=>
{
if
(
req
.
session
&&
req
.
session
.
authState
&&
req
.
session
.
authState
===
req
.
query
.
state
)
{
if
(
req
.
query
.
err
)
{
log
.
error
(
`
qq
authenticate
error
:
$
{
JSON
.
stringify
(
err
)}
`
);
log
.
error
(
`
qq
authenticate
error
:
$
{
JSON
.
stringify
(
req
.
query
.
err
)}
`
);
return
res
.
redirect
(
loginPageURL
);
}
...
...
apps/passport/views/action/bind/bind-set-pwd.hbs
View file @
800e35b
...
...
@@ -29,7 +29,7 @@
<li>
<div>
<a
id=
"next"
class=
"btn btn-fixed-height
disable
"
>
确认
</a>
<a
id=
"next"
class=
"btn btn-fixed-height"
>
确认
</a>
</div>
</li>
</ul>
...
...
public/js/passport/back/reset.js
View file @
800e35b
...
...
@@ -91,4 +91,4 @@ $next.click(function() {
if
(
validatePassword
()
&&
validateRepassword
())
{
$
(
'#reset-pwd-form'
).
submit
();
}
});
\ No newline at end of file
});
...
...
public/js/passport/bind/third-pwd.js
View file @
800e35b
...
...
@@ -16,10 +16,6 @@ var $mobile = $('#mobile');
var
$area
=
$
(
'#area'
);
var
$next
=
$
(
'#next'
);
var
EventProxy
=
require
(
'yoho-eventproxy'
);
var
ep
=
new
EventProxy
();
require
(
'yoho-jquery-placeholder'
);
function
errTip
(
ele
,
msg
)
{
...
...
@@ -34,62 +30,46 @@ function hideTip(ele) {
return
ele
.
next
(
'.tips'
).
addClass
(
'hide'
);
}
// 确保二次密码输入正确
ep
.
tail
(
'pwd'
,
'repwd'
,
function
(
pwd
,
repwd
)
{
if
(
pwd
&&
repwd
)
{
$next
.
removeClass
(
'disable'
);
}
else
{
$next
.
addClass
(
'disable'
);
}
});
$passwordInput
.
on
(
'keyup blur'
,
function
()
{
$passwordInput
.
on
(
'blur'
,
function
()
{
var
length
=
$passwordInput
.
val
().
length
;
$passwordInput
.
removeClass
(
'focus'
);
if
(
length
===
0
)
{
errTip
(
$passwordInput
,
'请输入密码'
);
ep
.
emit
(
'pwd'
,
false
);
return
;
}
if
(
length
<
6
||
length
>
20
)
{
errTip
(
$passwordInput
,
'密码只支持 6-20 位字符,建议字母+数字的组合'
);
ep
.
emit
(
'pwd'
,
false
);
return
;
}
if
(
!
pwdRegx
.
test
(
$passwordInput
.
val
()))
{
errTip
(
$passwordInput
,
'密码只支持 6-20 位字符,建议字母+数字的组合'
);
ep
.
emit
(
'pwd'
,
false
);
return
;
}
ep
.
emit
(
'pwd'
,
true
);
}).
on
(
'focus'
,
function
()
{
hideTip
(
$passwordInput
);
$passwordInput
.
addClass
(
'focus'
);
});
$repasswordInput
.
on
(
'
keyup
blur'
,
function
()
{
$repasswordInput
.
on
(
'blur'
,
function
()
{
var
length
=
$repasswordInput
.
val
().
length
;
$repasswordInput
.
removeClass
(
'focus'
);
if
(
length
===
0
)
{
errTip
(
$repasswordInput
,
'请再次输入密码'
);
ep
.
emit
(
'repwd'
,
false
);
return
;
}
if
(
$passwordInput
.
val
()
!==
$repasswordInput
.
val
())
{
errTip
(
$repasswordInput
,
'两次输入的密码不一致,请重新输入'
);
ep
.
emit
(
'repwd'
,
false
);
return
;
}
ep
.
emit
(
'repwd'
,
true
);
}).
on
(
'focus'
,
function
()
{
hideTip
(
$repasswordInput
);
$repasswordInput
.
addClass
(
'focus'
);
...
...
@@ -119,25 +99,10 @@ function nextPage() {
$
(
'[placeholder]'
).
placeholder
();
$next
.
on
(
'click'
,
function
()
{
if
(
$next
.
hasClass
(
'disable'
))
{
return
;
}
if
(
$passwordInput
.
val
()
!==
$repasswordInput
.
val
())
{
if
((
$
.
trim
(
$passwordInput
.
val
())
===
''
)
||
(
$passwordInput
.
val
()
!==
$repasswordInput
.
val
()))
{
errTip
(
$repasswordInput
,
'两次输入的密码不一致,请重新输入'
);
return
;
}
nextPage
();
});
ep
.
on
(
'repwd'
,
function
(
repwdAuth
)
{
if
(
repwdAuth
)
{
hideTip
();
}
});
ep
.
on
(
'pwd'
,
function
(
pwdAuth
)
{
if
(
pwdAuth
)
{
hideTip
();
}
});
...
...
Please
register
or
login
to post a comment