lrf402788946 il y a 4 ans
Parent
commit
a8b2314d05
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 2 2
      app/controller/files.js
  2. 2 2
      config/config.default.js

+ 2 - 2
app/controller/files.js

@@ -67,11 +67,11 @@ class FilesController extends Controller {
   }
 
   async wxupload() {
-    const { serverid, type } = this.ctx.request.body;
+    const { serverid, type, appid } = this.ctx.request.body;
     assert(serverid, 'serverid不允许为空');
     assert(type, 'type不允许为空');
     const { ctx, app } = this;
-    const url = app.config.wx.wxdown + serverid;
+    const url = app.config.wx.wxdown(appid, serverid);
     console.log(url);
     console.log(type);
     const file = await this.ctx.curl(url);

+ 2 - 2
config/config.default.js

@@ -27,7 +27,7 @@ module.exports = appInfo => {
 
   config.cluster = {
     listen: {
-      port: 8001,
+      port: 8101,
     },
   };
 
@@ -45,7 +45,7 @@ module.exports = appInfo => {
   };
 
   config.wx = {
-    wxdown: 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/media/get?appid=wxdf3ed83c095be97a&media_id=',
+    wxdown: (appid, media_id) => `http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/media/get?appid=${appid}&media_id=${media_id}`,
     appid: 'wxdf3ed83c095be97a',
   };