Browse Source

重写index方法

liuyu 5 năm trước cách đây
mục cha
commit
0b4083391f
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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() {