liuyu před 4 roky
rodič
revize
5b8626c0c7
1 změnil soubory, kde provedl 1 přidání a 7 odebrání
  1. 1 7
      app/controller/weixin.js

+ 1 - 7
app/controller/weixin.js

@@ -66,13 +66,7 @@ class WeixinController extends Controller {
     console.log('code-->' + code);
 
     const { weixin } = this.ctx.service;
-    let openid;
-    try {
-      ({ openid } = await weixin.fetch(code));
-    } catch (err) {
-      await this.ctx.render('error.njk', { title: err.message, message: err.details });
-      return;
-    }
+    const openid = await weixin.fetch(code);
     console.log('openid--->' + openid);
     if (openid) {
       const key = `visit:auth:state:${state}`;