Skip to content

Commit

Permalink
docs(controller): session example bug (#2313)
Browse files Browse the repository at this point in the history
  • Loading branch information
thonatos authored and popomore committed Apr 4, 2018
1 parent e0e7ed1 commit 7fba689
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/basics/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ class PostController extends Controller {
const userId = ctx.session.userId;
const posts = await ctx.service.post.fetch(userId);
// set value to Session
ctx.session.visited = ctx.session.visited ? ctx.session.visited++ : 1;
ctx.session.visited = ctx.session.visited ? ++ctx.session.visited : 1;
ctx.body = {
success: true,
posts,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/zh-cn/basics/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ class PostController 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;
ctx.body = {
success: true,
posts,
Expand Down

0 comments on commit 7fba689

Please sign in to comment.