reloaded 5 年之前
父節點
當前提交
08875e40fa
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      app/controller/comment.js
  2. 1 1
      app/service/comment.js

+ 1 - 1
app/controller/comment.js

@@ -12,7 +12,7 @@ class CommentController extends Controller {
     this.service = this.ctx.service.comment;
     this.service = this.ctx.service.comment;
   }
   }
 
 
-  async query() {
+  async show() {
     const res = await this.service.query(this.ctx.query);
     const res = await this.service.query(this.ctx.query);
     this.ctx.ok({ ...res });
     this.ctx.ok({ ...res });
   }
   }

+ 1 - 1
app/service/comment.js

@@ -17,7 +17,7 @@ class CommentService extends CrudService {
     const total = await (await this.model.find(info)).length;
     const total = await (await this.model.find(info)).length;
     const comments = await this.model.find(info).skip(Number(skip)).limit(Number(limit));
     const comments = await this.model.find(info).skip(Number(skip)).limit(Number(limit));
     for (const comment of comments) {
     for (const comment of comments) {
-      const url = "http://127.0.0.1:9999/api/auth/user/" + comment.uid;
+      const url = 'http://127.0.0.1:9999/api/auth/user/' + comment.uid;
       const user = await this.ctx.curl(url, {
       const user = await this.ctx.curl(url, {
         method: 'get',
         method: 'get',
         headers: {
         headers: {