liuyu 4 年之前
父節點
當前提交
5b8626c0c7
共有 1 個文件被更改,包括 1 次插入7 次删除
  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}`;