From ff79101b592d59ad12d110dd26dd7fa3d044b968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E9=87=91?= Date: Tue, 13 Nov 2018 16:19:37 +0800 Subject: [PATCH] docs: Update service.md (#3191) --- docs/source/en/basics/service.md | 1 + docs/source/zh-cn/basics/service.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/source/en/basics/service.md b/docs/source/en/basics/service.md index a25e9beb1b..404f35941e 100644 --- a/docs/source/en/basics/service.md +++ b/docs/source/en/basics/service.md @@ -75,6 +75,7 @@ module.exports = app => { const Controller = require('egg').Controller; class UserController extends Controller { async info() { + const { ctx } = this; const userId = ctx.params.id; const userInfo = await ctx.service.user.find(userId); ctx.body = userInfo; diff --git a/docs/source/zh-cn/basics/service.md b/docs/source/zh-cn/basics/service.md index 608fc5b3bb..1f31689395 100644 --- a/docs/source/zh-cn/basics/service.md +++ b/docs/source/zh-cn/basics/service.md @@ -75,6 +75,7 @@ module.exports = app => { const Controller = require('egg').Controller; class UserController extends Controller { async info() { + const { ctx } = this; const userId = ctx.params.id; const userInfo = await ctx.service.user.find(userId); ctx.body = userInfo;