liuyu 5 years ago
parent
commit
aa38a14d64
3 changed files with 9 additions and 9 deletions
  1. 1 1
      app/controller/.message.js
  2. 3 3
      app/service/rabbitmq.js
  3. 5 5
      config/config.default.js

+ 1 - 1
app/controller/.message.js

@@ -20,7 +20,7 @@ module.exports = {
   },
   },
   index: {
   index: {
     parameters: {
     parameters: {
-      params: ['userid', 'type']
+      query: ['userid', 'type']
     },
     },
     service: 'query',
     service: 'query',
     options: {
     options: {

+ 3 - 3
app/service/rabbitmq.js

@@ -69,7 +69,7 @@ class RabbitmqService extends Service {
           // const properties = msg.properties;
           // const properties = msg.properties;
           const headers = msg.properties.headers;
           const headers = msg.properties.headers;
           // 插入待办事项到数据库中。
           // 插入待办事项到数据库中。
-          const path = self.ctx.app.config.baseDir + self.ctx.app.config.corpsDir + headers.userid;
+          const path = self.ctx.app.config.baseDirMq + self.ctx.app.config.corpsDirMq + headers.userid;
           const corp = self.ctx.curl(path, {
           const corp = self.ctx.curl(path, {
             method: 'GET',
             method: 'GET',
             dataType: 'json',
             dataType: 'json',
@@ -107,7 +107,7 @@ class RabbitmqService extends Service {
           // const properties = msg.properties;
           // const properties = msg.properties;
           const headers = msg.properties.headers;
           const headers = msg.properties.headers;
           // 插入待办事项到数据库中。
           // 插入待办事项到数据库中。
-          const path = self.ctx.app.config.baseDir + self.ctx.app.config.stusDir + headers.userid;
+          const path = self.ctx.app.config.baseDirMq + self.ctx.app.config.stusDirMq + headers.userid;
           // const path = 'http://10.16.5.15:8101/api/studentcorp' + headers.userid;
           // const path = 'http://10.16.5.15:8101/api/studentcorp' + headers.userid;
           const stus = self.ctx.curl(path, {
           const stus = self.ctx.curl(path, {
             method: 'GET',
             method: 'GET',
@@ -115,7 +115,7 @@ class RabbitmqService extends Service {
           });
           });
           for (const elem of stus.data) {
           for (const elem of stus.data) {
 
 
-            const pathStu = self.ctx.app.config.baseDir + self.ctx.app.config.strDir + elem.id;
+            const pathStu = self.ctx.app.config.baseDirMq + self.ctx.app.config.strDirMq + elem.id;
             const stud = self.ctx.curl(pathStu, {
             const stud = self.ctx.curl(pathStu, {
               method: 'GET',
               method: 'GET',
               dataType: 'json',
               dataType: 'json',

+ 5 - 5
config/config.default.js

@@ -51,15 +51,15 @@ module.exports = appInfo => {
   //   },
   //   },
   // };
   // };
   // base路径
   // base路径
-  config.sendDir = 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=';
+  config.sendDirMq = 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=';
   // base路径
   // base路径
-  config.baseDir = 'http://smart.cc-lotus.info';
+  config.baseDirMq = 'http://smart.cc-lotus.info';
   // 企业信息url
   // 企业信息url
-  config.corpsDir = '/api/corp/corps/';
+  config.corpsDirMq = '/api/corp/corps/';
   // 学生信息url
   // 学生信息url
-  config.stusDir = '/api/studentcorp';
+  config.stusDirMq = '/api/studentcorp';
   // 学生详细信息
   // 学生详细信息
-  config.strDir = '/api/stud/registers/';
+  config.strDirMq = '/api/stud/registers/';
 
 
   // mq config
   // mq config
   config.amqp = {
   config.amqp = {