liuyu 4 vuotta sitten
vanhempi
commit
2175176309
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      app/controller/weixin.js

+ 2 - 1
app/controller/weixin.js

@@ -49,11 +49,12 @@ class WeixinController extends Controller {
     // TODO: 生成回调地址
     // TODO: 生成回调地址
     const { wxapi, authUrl = this.ctx.path } = this.app.config;
     const { wxapi, authUrl = this.ctx.path } = this.app.config;
     const backUrl = encodeURI(`${this.app.config.baseUrl}${this.config.authUrl}?state=${state}`);
     const backUrl = encodeURI(`${this.app.config.baseUrl}${this.config.authUrl}?state=${state}`);
-    const to_uri = `${wxapi.baseUrl}/api/auth?appid=${wxapi.appid}&response_type=code&redirect_uri=${backUrl}&connect_redirect=1#wechat`;
+    const to_uri = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wxapi.appid}&response_type=code&redirect_uri=${backUrl}&connect_redirect=1#wechat`;
     console.log('url-->' + to_uri);
     console.log('url-->' + to_uri);
     this.ctx.redirect(to_uri);
     this.ctx.redirect(to_uri);
   }
   }
 
 
+
   // GET 认证回调
   // GET 认证回调
   async authBack({ code, state }) {
   async authBack({ code, state }) {
     // const { code, state, type, redirecturi } = this.ctx.query;
     // const { code, state, type, redirecturi } = this.ctx.query;