Skip to content

Commit

Permalink
docs(session): fix bug in example code of modify session value (#2824)
Browse files Browse the repository at this point in the history
  • Loading branch information
BaffinLee authored and atian25 committed Jul 20, 2018
1 parent b55b303 commit c0b0bb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/en/core/cookie-and-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class HomeController extends Controller {
const userId = ctx.session.userId;
const posts = await ctx.service.post.fetch(userId);
// modify session value
ctx.session.visited = ctx.session.visited ? ctx.session.visited++ : 1;
ctx.session.visited = ctx.session.visited ? (ctx.session.visited + 1) : 1;
ctx.body = {
success: true,
posts,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/zh-cn/core/cookie-and-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class HomeController extends Controller {
const userId = ctx.session.userId;
const posts = await ctx.service.post.fetch(userId);
// 修改 Session 的值
ctx.session.visited = ctx.session.visited ? ctx.session.visited++ : 1;
ctx.session.visited = ctx.session.visited ? (ctx.session.visited + 1) : 1;
ctx.body = {
success: true,
posts,
Expand Down

0 comments on commit c0b0bb8

Please sign in to comment.