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
2219a4dd5e21befba6ffff2571c99554a3d25642
1 parent
1fe21f95
fix tips
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
10 deletions
apps/passport/controllers/login.js
doraemon/middleware/auth.js
public/js/passport/bind/third-login.js
public/js/passport/reg/reg.js
public/js/plugins/tips.js
public/scss/shopping/_tooltip.css
apps/passport/controllers/login.js
View file @
2219a4d
...
...
@@ -191,7 +191,7 @@ const local = {
res
.
clearCookie
(
'_g'
);
res
.
clearCookie
(
'isRemember'
);
res
.
clearCookie
(
'remem'
);
res
.
redirect
(
req
.
get
(
'Referer'
)
||
config
.
siteUrl
);
res
.
redirect
(
config
.
siteUrl
);
}
};
...
...
doraemon/middleware/auth.js
View file @
2219a4d
...
...
@@ -14,9 +14,18 @@ module.exports = (req, res, next) => {
return
req
.
protocol
+
'://'
+
req
.
get
(
'host'
)
+
req
.
originalUrl
;
};
let
loginUrl
=
helpers
.
urlFormat
(
'/passport/login'
,
{
refer
:
req
.
getUrl
()});
if
(
_
.
isEmpty
(
req
.
user
)
||
!
req
.
user
.
uid
)
{
return
res
.
redirect
(
helpers
.
urlFormat
(
'/passport/login'
,
{
refer
:
req
.
getUrl
()}));
}
if
(
req
.
xhr
)
{
return
res
.
json
({
code
:
400
,
message
:
'抱歉,您暂未登录!'
,
data
:
{
refer
:
loginUrl
}
});
}
return
res
.
redirect
(
loginUrl
);
}
next
();
};
...
...
public/js/passport/bind/third-login.js
View file @
2219a4d
...
...
@@ -133,7 +133,8 @@ $phoneNumInput.on('blur', function() {
// 这里只做中国区验证
if
(
$regionCodeText
.
text
()
===
'+86'
)
{
if
(
$phoneNumInput
.
length
===
11
&&
phoneRegx
[
'+86'
].
test
(
$phoneNumInput
.
val
()))
{
if
(
length
===
11
&&
phoneRegx
[
'+86'
].
test
(
$phoneNumInput
.
val
()))
{
ep
.
emit
(
'phoneNum'
,
true
);
return
;
}
else
{
...
...
public/js/passport/reg/reg.js
View file @
2219a4d
...
...
@@ -42,6 +42,9 @@ require('yoho-jquery-placeholder');
require
(
'../../plugins/tips'
);
function
errTip
(
ele
,
msg
)
{
//ele.tips('show', msg)
var
topLeft
=
ele
.
offset
();
$errMsg
.
text
(
msg
);
...
...
@@ -244,14 +247,15 @@ function validatePhoneNumLocal() {
regionCode
=
$regionCodeText
.
text
();
if
(
length
===
0
)
{
errTip
(
$phone
,
'请输入手机号码'
);
return
false
;
}
if
(
/^
[
0-9
]
+$/
.
test
(
$phoneNumInput
.
val
()
))
{
if
(
/^
[
0-9
]
+$/
.
test
(
phoneNum
))
{
// 这里只做中国区验证
if
(
regionCode
===
'+86'
)
{
if
(
phoneNum
.
length
===
11
&&
regValidate
.
phoneRegx
[
'+86'
].
test
(
phoneNum
.
val
()
))
{
if
(
length
===
11
&&
regValidate
.
phoneRegx
[
'+86'
].
test
(
phoneNum
))
{
return
true
;
}
else
{
errTip
(
$phone
,
'手机号码不正确,请重新输入'
);
...
...
@@ -333,7 +337,7 @@ function validatePassword() {
function
validatePasswordComplexLocal
(
$obj
)
{
var
pwd
=
$obj
.
val
(),
level
=
computeComplex
(
pwd
);
console
.
log
(
level
);
switch
(
level
)
{
case
0
:
$pwdParent
.
removeClass
(
'red yellow green'
);
...
...
public/js/plugins/tips.js
View file @
2219a4d
...
...
@@ -27,7 +27,7 @@ var jQuery = require('yoho-jquery'),
}
else
{
_that
.
isInit
=
true
;
this
.
append
(
tplFn
({
content
:
arguments
[
0
]}));
$tips
=
this
.
find
(
'.tips'
);
$tips
=
this
.
find
(
'.tips'
)
.
removeClass
(
'hide'
)
;
$tips
.
css
({
top
:
topLeft
.
top
+
this
.
height
()
-
2
,
left
:
topLeft
.
left
,
...
...
@@ -36,7 +36,7 @@ var jQuery = require('yoho-jquery'),
});
}
return
this
.
removeClass
(
'hide'
)
;
return
this
;
},
hide
:
function
()
{
if
(
_that
.
isInit
)
{
...
...
public/scss/shopping/_tooltip.css
View file @
2219a4d
.tooltip
{
position
:
relativ
e
;
position
:
absolut
e
;
font-weight
:
normal
!important
;
.content
{
...
...
Please
register
or
login
to post a comment