From 4f2ebfda81c067ba500ee22ac30c8b201f746cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TZ=20=7C=20=E5=A4=A9=E7=8C=AA?= Date: Fri, 28 Jul 2017 10:28:55 +0800 Subject: [PATCH] docs: fix const define (#1249) --- .eslintignore | 1 + docs/source/zh-cn/core/cookie-and-session.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index eb984b683c..dacb55c46c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,4 @@ test/fixtures examples/**/app/public logs run +docs/node_modules diff --git a/docs/source/zh-cn/core/cookie-and-session.md b/docs/source/zh-cn/core/cookie-and-session.md index 4ba35464aa..72c333b003 100644 --- a/docs/source/zh-cn/core/cookie-and-session.md +++ b/docs/source/zh-cn/core/cookie-and-session.md @@ -9,14 +9,14 @@ HTTP 请求都是无状态的,但是我们的 Web 应用通常都需要知道 ```js exports.add = function* (ctx) { - const count = ctx.cookies.get('count'); + let count = ctx.cookies.get('count'); count = count ? Number(count) : 0; ctx.cookies.set('count', ++count); ctx.body = count; }; exports.remove = function* (ctx) { - const count = ctx.cookies.set('count', null); + ctx.cookies.set('count', null); ctx.status = 204; }; ```