浏览代码

重写index方法

liuyu 5 年之前
父节点
当前提交
0b4083391f
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      app/controller/student.js

+ 6 - 0
app/controller/student.js

@@ -12,6 +12,12 @@ class StudentController extends Controller {
     super(ctx);
     this.service = this.ctx.service.student;
   }
+
+  async index() {
+    const data = await this.service.query(this.ctx.query);
+    this.ctx.ok({ ...data });
+  }
+
   // GET
   // 查询
   async seek() {