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
周少峰
8 years ago
Commit
0a3eec1e0944c8bfcaabc0bf092f1f1a70aa0354
1 parent
1dcbfa25
del check user
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
25 deletions
apps/passport/controllers/back.js
apps/passport/router.js
public/js/passport/back/back.js
apps/passport/controllers/back.js
View file @
0a3eec1
...
...
@@ -88,21 +88,6 @@ const getUserInfoAPI = (req, res, next) => {
.
catch
(
next
);
};
// 成功 next ,否则 return err json
const
getUserInfoAPINoRes
=
(
req
,
res
,
next
)
=>
{
let
inputInfo
=
req
.
inputInfo
;
req
.
session
.
type
=
'back-step1'
;
service
.
findUserAsync
(
inputInfo
.
type
,
inputInfo
.
phone
,
inputInfo
.
area
).
then
(
d
=>
{
if
(
d
.
code
===
200
)
{
return
next
();
}
else
{
return
res
.
json
(
d
);
}
}).
catch
(
next
);
};
const
fakeGetUserInfoAPI
=
(
req
,
res
)
=>
{
return
res
.
json
({
code
:
200
,
message
:
'验证成功'
});
};
...
...
@@ -110,6 +95,7 @@ const fakeGetUserInfoAPI = (req, res) => {
const
sendCodePage
=
(
req
,
res
,
next
)
=>
{
let
inputInfo
=
req
.
inputInfo
;
req
.
session
.
type
=
'back-step1'
;
service
.
sendCodeToUserAsync
(
inputInfo
.
type
,
inputInfo
.
phone
,
inputInfo
.
area
)
.
then
(
result
=>
{
if
(
!
(
result
.
code
&&
result
.
code
===
200
))
{
...
...
@@ -504,7 +490,6 @@ module.exports = {
index
,
// 首页
fakeGetUserInfoAPI
,
// 通过邮箱或手机号获得用户信息
getUserInfoAPI
,
// 通过邮箱或手机号获得用户信息
getUserInfoAPINoRes
,
// 通过邮箱或手机号获得用户信息
sendCodePage
,
// 发送验证码到邮箱或者手机,然后跳转页面
saveInSession
,
// 保存状态到session中
...
...
apps/passport/router.js
View file @
0a3eec1
...
...
@@ -130,7 +130,6 @@ router.post('/passport/back/authcode',
router
.
post
(
'/passport/back/email'
,
captcha
.
requiredAPI
,
back
.
validateInputAPI
,
back
.
getUserInfoAPINoRes
,
back
.
sendCodePage
,
back
.
saveInSession
);
...
...
public/js/passport/back/back.js
View file @
0a3eec1
...
...
@@ -12,8 +12,7 @@ var Captcha = require('../../plugins/captcha');
var
emailAc
=
require
(
'../common/ac-email'
);
// 邮箱自动完成
var
emailReg
=
regx
.
emailRegx
,
phoneRegx
=
regx
.
phoneRegx
;
var
emailReg
=
regx
.
emailRegx
;
var
$cr
=
$
(
'#country-code-hide'
),
$phoneNum
=
$
(
'#phone-num'
),
...
...
@@ -37,12 +36,7 @@ function vaPn(v) {
v
=
$
.
trim
(
v
);
if
(
v
!==
''
)
{
if
(
/^
[
0-9
]
+$/
.
test
(
v
))
{
if
(
phoneRegx
[
$cr
.
val
()].
test
(
v
))
{
pass
=
true
;
}
else
{
errTxt
=
'手机号码格式不正确, 请重新输入'
;
pass
=
false
;
}
pass
=
true
;
}
else
{
if
(
emailReg
.
test
(
v
))
{
pass
=
true
;
...
...
Please
register
or
login
to post a comment