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
徐炜
9 years ago
Commit
a71e46aebac0001311998eb973e4b0984d5a217e
1 parent
bf1fb2e6
https
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
apps/me/controllers/setting.js
apps/me/controllers/setting.js
View file @
a71e46a
...
...
@@ -87,7 +87,7 @@ const cookieHelper = {
getVal
(
req
,
k
)
{
return
req
.
cookies
[
k
];
}
}
}
;
/**
* 个人设置页面加载
...
...
@@ -265,7 +265,7 @@ const modifyType = (req, res) => {
const
edit
=
(
req
,
res
)
=>
{
let
type
=
req
.
params
.
type
;
if
(
Number
(
cookieHelper
.
getVal
(
req
,
type
+
"_STEP"
))
!==
1
)
{
if
(
Number
(
cookieHelper
.
getVal
(
req
,
type
+
'_STEP'
))
!==
1
)
{
res
.
redirect
(
helpers
.
urlFormat
(
'/me/setting/step1/'
+
type
));
return
;
}
...
...
@@ -304,14 +304,14 @@ const edit = (req, res) => {
const
success
=
(
req
,
res
)
=>
{
let
type
=
req
.
params
.
type
;
let
step
=
Number
(
cookieHelper
.
getVal
(
req
,
type
+
"_STEP"
))
||
0
;
let
step
=
Number
(
cookieHelper
.
getVal
(
req
,
type
+
'_STEP'
))
||
0
;
if
(
step
!==
2
)
{
res
.
redirect
(
helpers
.
urlFormat
(
'/me/setting/step'
+
(
step
+
1
)
+
'/'
+
type
));
return
;
}
cookieHelper
.
setVal
(
res
,
type
+
"_STEP"
,
0
,
{
cookieHelper
.
setVal
(
res
,
type
+
'_STEP'
,
0
,
{
maxAge
:
-
1
});
...
...
@@ -363,7 +363,7 @@ const validate1 = (req, res) => {
}
if
(
a
)
{
cookieHelper
.
setVal
(
res
,
req
.
body
.
type
+
"_STEP"
,
1
);
cookieHelper
.
setVal
(
res
,
req
.
body
.
type
+
'_STEP'
,
1
);
res
.
send
(
a
);
}
})();
...
...
@@ -382,7 +382,7 @@ const validate2 = (req, res) => {
let
a
=
yield
accountModel
.
changePwd
(
uid
,
body
.
password
);
if
(
a
.
code
===
200
)
{
cookieHelper
.
setVal
(
res
,
body
.
type
+
"_STEP"
,
2
);
cookieHelper
.
setVal
(
res
,
body
.
type
+
'_STEP'
,
2
);
res
.
send
(
a
);
}
...
...
@@ -391,7 +391,7 @@ const validate2 = (req, res) => {
let
b
=
yield
accountModel
.
modifyVerifyMobile
(
uid
,
body
.
area
,
body
.
mobile
);
if
(
a
.
code
===
200
&&
b
.
code
===
200
)
{
cookieHelper
.
setVal
(
res
,
body
.
type
+
"_STEP"
,
2
);
cookieHelper
.
setVal
(
res
,
body
.
type
+
'_STEP'
,
2
);
res
.
send
({
code
:
200
,
data
:
{}
...
...
Please
register
or
login
to post a comment