lrf402788946 4 年 前
コミット
7762619ba5
4 ファイル変更7 行追加10 行削除
  1. 1 5
      app/controller/weixin.js
  2. 2 1
      app/router.js
  3. 1 1
      app/service/weixin.js
  4. 3 3
      config/config.default.js

+ 1 - 5
app/controller/weixin.js

@@ -7,12 +7,8 @@ class WeixinController extends Controller {
     super(ctx);
     this.service = this.ctx.service.weixin;
   }
-  async index() {
-    console.log(this.ctx.params, this.ctx.query);
-    this.ctx.ok();
-  }
   async auth() {
-    await this.service.auth(this.ctx.query);
+    await this.service.auth(this.ctx.params, this.ctx.query);
   }
   async authBack() {
     await this.service.authBack(this.ctx.query);

+ 2 - 1
app/router.js

@@ -8,7 +8,8 @@ module.exports = app => {
   router.get('/', controller.home.index);
   const profix = '/api/live/';
   const vision = 'v0';
-  router.get(`${profix}${vision}/wxlogin/:site`, controller.weixin.index);
+  router.get(`${profix}${vision}/wxlogin/:site`, controller.weixin.auth);
+  router.get(`${profix}${vision}/authBack`, controller.weixin.authBack);
   router.post(`${profix}${vision}/util`, controller.home.utilMethod);
   router.post(`${profix}${vision}/spm`, controller.home.spm);
   router.get(`${profix}${vision}/index`, controller.home.indexQuery);

+ 1 - 1
app/service/weixin.js

@@ -18,7 +18,7 @@ class WeixinAuthService extends AxiosService {
     this.jsapiKey = 'jsapi_ticket';
     this.access_tokenKey = 'access_token';
     this.wxInfo = ctx.app.config.wxapi;
-    this.authBackUrl = `${ctx.app.config.baseUrl}/api/article/authBack`;
+    this.authBackUrl = `${ctx.app.config.baseUrl}/api/live/v0/authBack`;
   }
   /**
    * 网页授权

+ 3 - 3
config/config.default.js

@@ -62,7 +62,7 @@ module.exports = appInfo => {
     client: {
       port: 6379, // Redis port
       host: '127.0.0.1', // Redis host
-      password: 123456,
+      password: '',
       db: 1,
     },
   };
@@ -87,8 +87,8 @@ module.exports = appInfo => {
     appSecret: 'd85dbe075c090cb12ce416bbda8e698c',
     baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
     kjzl: {
-      appid: '',
-      appSecret: '',
+      appid: 'wxcf1b5457939b0932',
+      appSecret: 'f9a947c4a11f5304fc0bcabef98093d8',
     },
   };
   return {