소스 검색

重写index方法

liuyu 4 년 전
부모
커밋
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() {