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