lrf402788946 4 years ago
parent
commit
b3b9bb3023
2 changed files with 2 additions and 5 deletions
  1. 2 2
      app/controller/weixin.js
  2. 0 3
      app/service/weixin.js

+ 2 - 2
app/controller/weixin.js

@@ -202,11 +202,11 @@ class WeixinController extends Controller {
 
   // GET 签到小程序请求用户
   async appAuth() {
+    console.warn('in appAuth');
     const { js_code, login = true } = this.ctx.query;
-    console.warn(`query=>${JSON.stringify(this.ctx.query)}`);
-    console.warn(`js_code=>${js_code}`);
     const appopenid = await this.ctx.service.weixin.appAuth(js_code);
     if (!login) this.ctx.ok(appopenid);
+    console.warn(`openid=>${appopenid}`);
     const res = await this.findByAppOpenid(appopenid);
     this.ctx.ok(res);
   }

+ 0 - 3
app/service/weixin.js

@@ -288,7 +288,6 @@ class WeixinAuthService extends AxiosService {
       query = `${query}&${key}=${wxapp[key]}`;
     }
     url = `${url}${query}`;
-    console.warn(`url=>${url}`);
     const res = await this.ctx.curl(url, {
       method: 'get',
       headers: {
@@ -296,8 +295,6 @@ class WeixinAuthService extends AxiosService {
       },
       dataType: 'json',
     });
-    console.warn('res=>');
-    console.warn(res);
     const { openid } = res.data;
     if (!openid) throw new BusinessError(ErrorCode.BUSINESS, '未获取到openid', '未获取到openid');
     return openid;