Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
5b745da990a8e0468e124e24fcffefb176fdae30
1 parent
e62bd484
fix login
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
31 deletions
apps/passport/views/action/login/index.hbs
public/js/passport/login/index.js
apps/passport/views/action/login/index.hbs
View file @
5b745da
...
...
@@ -6,10 +6,10 @@
<ul
class=
"login-ul"
>
<div
class=
"switch-login-type"
data-type=
"DesktopLogin"
>
<div
id=
"device-bg"
class=
"type-mobile-bg"
></div>
<div
class=
"type-tip tip-title"
>
<div
id=
"device-tip"
style=
"margin-left: 15px;margin-top: 8px"
>
扫码登录更安全
</div>
</div>
<div
id=
"device-bg"
class=
"type-mobile-bg"
></div>
<div
class=
"type-tip tip-title"
>
<div
id=
"device-tip"
style=
"margin-left: 15px;margin-top: 8px"
>
扫码登录更安全
</div>
</div>
</div>
<div
class=
"desktop-login"
>
...
...
@@ -30,7 +30,7 @@
<li
class=
"relative"
>
<div
class=
"switch"
>
<div
class=
"left selected"
data-type=
"PasswordLogin"
>
普通登录
</div>
<div
class=
"right"
data-type=
"SMSLogin"
>
手机验证码登录
</div>
<div
class=
"right"
data-type=
"SMSLogin"
>
手机验证码登录
</div>
</div>
</li>
...
...
@@ -55,20 +55,10 @@
</span>
</li>
<li
class=
"relative clearfix sms-login hide"
>
<input
id=
"account2"
class=
"account input va"
name=
"account2"
value=
"
{{
bindMobile
}}
"
type=
"text"
placeholder=
"手机号码"
autocomplete=
"off"
>
<span
class=
"err-tip hide"
>
<i></i>
<em></em>
</span>
</li>
<li
class=
"clearfix sms-captcha-img-wrap captcha-wrap sms-login hide"
>
<input
id=
"sms-captcha-input"
class=
"input va captcha"
type=
"text"
name=
"captcha"
placeholder=
"图形验证码"
<li
class=
"clearfix captcha-wrap hide"
>
<input
id=
"captcha"
class=
"input va captcha"
type=
"text"
name=
"captcha"
placeholder=
"图形验证码"
autocomplete=
"off"
maxlength=
"4"
>
<img
id=
"
sms-
captcha-img"
class=
"captcha-img"
alt=
""
>
<img
id=
"captcha-img"
class=
"captcha-img"
alt=
""
>
<a
class=
"link change-captcha"
>
换一张
</a>
<span
class=
"err-tip hide"
>
<i></i>
...
...
@@ -76,21 +66,21 @@
</span>
</li>
<li
class=
"relative clearfix sms-login hide"
>
<input
id=
"captcha-sms"
class=
"input va captcha-sms-input"
type=
"text"
name=
"captcha"
placeholder=
"短信验证码"
autocomplete=
"off"
maxlength=
"4"
>
<div
class=
"change-captcha-sms btn"
>
获取短信验证码
</div>
<span
class=
"err-tip hide"
>
<i></i>
<em></em>
</span>
</li>
<li
class=
"relative clearfix sms-login hide"
>
<input
id=
"account2"
class=
"account input va"
name=
"account2"
value=
"
{{
bindMobile
}}
"
type=
"text"
placeholder=
"手机号码"
autocomplete=
"off"
>
<span
class=
"err-tip hide"
>
<i></i>
<em></em>
</span>
</li>
<li
class=
"clearfix captcha-wrap hide"
>
<input
id=
"captcha"
class=
"input va captcha"
type=
"text"
name=
"captcha"
placeholder=
"图形验证码"
<li
class=
"relative clearfix sms-captcha-img-wrap sms-login hide"
>
<input
id=
"sms-captcha-input"
class=
"input va captcha"
type=
"text"
name=
"captcha"
placeholder=
"图形验证码"
autocomplete=
"off"
maxlength=
"4"
>
<img
id=
"captcha-img"
class=
"captcha-img"
alt=
""
>
<img
id=
"
sms-
captcha-img"
class=
"captcha-img"
alt=
""
>
<a
class=
"link change-captcha"
>
换一张
</a>
<span
class=
"err-tip hide"
>
<i></i>
...
...
@@ -98,6 +88,17 @@
</span>
</li>
<li
class=
"relative clearfix sms-login hide"
>
<input
id=
"captcha-sms"
class=
"input va captcha-sms-input"
type=
"text"
name=
"captcha"
placeholder=
"短信验证码"
autocomplete=
"off"
maxlength=
"4"
>
<div
class=
"change-captcha-sms btn"
>
获取短信验证码
</div>
<span
class=
"err-tip hide"
>
<i></i>
<em></em>
</span>
</li>
<li
class=
"desktop-login"
>
<span
id=
"login-btn"
class=
"login-btn btn"
>
登录
</span>
</li>
...
...
public/js/passport/login/index.js
View file @
5b745da
...
...
@@ -55,6 +55,7 @@ var $accountInput1 = $('#account1'),
$captchaImgInput
=
$
(
'#captcha'
),
$captchaImgWrapper
=
$
(
'.captcha-wrap'
),
$captchaImgPic
=
$captchaImgWrapper
.
find
(
'#captcha-img'
),
$showCaptchImg
=
false
,
getCaptchaImgVal
=
function
()
{
return
$
.
trim
(
$captchaImgInput
.
val
());
},
...
...
@@ -281,6 +282,19 @@ accountChangeEvent.add(function(type) {
$qrCodeOverLayer
.
empty
();
initQrCode
();
// eslint-disable-line
}
// 密码登录的图形验证码
if
(
type
===
AccountLoginData
.
PasswordLogin
.
name
)
{
if
(
$showCaptchImg
)
{
$captchaImgWrapper
.
removeClass
(
'hide'
);
}
}
if
(
type
===
AccountLoginData
.
SMSLogin
.
name
)
{
if
(
$showCaptchImg
)
{
$captchaImgWrapper
.
addClass
(
'hide'
);
}
}
});
// 保留已输入的帐号信息
...
...
@@ -983,6 +997,7 @@ function showCaptchaImgPic() {
$captchaImgPic
.
attr
(
'src'
,
CAPTCHA_IMG_URL
+
$
.
now
());
$captchaImgInput
.
val
(
''
);
$captchaImgWrapper
.
removeClass
(
'hide'
);
$showCaptchImg
=
true
;
}
// 设置 refer 信息
...
...
Please
register
or
login
to post a comment