lrf402788946 4 年 前
コミット
26ebd17f50
1 ファイル変更2 行追加1 行削除
  1. 2 1
      app/service/weixin.js

+ 2 - 1
app/service/weixin.js

@@ -17,7 +17,7 @@ class WeixinAuthService extends AxiosService {
     this.prefix = 'visit-auth:';
     this.prefix = 'visit-auth:';
     this.jsapiKey = 'visit-access_token';
     this.jsapiKey = 'visit-access_token';
     this.wxInfo = ctx.app.config.wxapi;
     this.wxInfo = ctx.app.config.wxapi;
-    this.authBackUrl = '/api/visit/authBack'; // ${ctx.app.config.baseUrl}
+    this.authBackUrl = `${ctx.app.config.baseUrl}/api/visit/authBack`;
   }
   }
   /**
   /**
    * 网页授权
    * 网页授权
@@ -51,6 +51,7 @@ class WeixinAuthService extends AxiosService {
    * @param {Object} query 参数
    * @param {Object} query 参数
    */
    */
   async authBack(query) {
   async authBack(query) {
+    console.log('in function:back');
     const { code, state } = query;
     const { code, state } = query;
     if (!code) throw new BusinessError(ErrorCode.SERVICE_FAULT, '授权未成功');
     if (!code) throw new BusinessError(ErrorCode.SERVICE_FAULT, '授权未成功');
     const { appid, appSecret } = this.wxInfo;
     const { appid, appSecret } = this.wxInfo;