|
@@ -43,7 +43,6 @@ class WeixinAuthService extends AxiosService {
|
|
backUrl = encodeURI(`${this.ctx.protocol}://${this.ctx.host}${this.authBackUrl}?state=${state}`);
|
|
backUrl = encodeURI(`${this.ctx.protocol}://${this.ctx.host}${this.authBackUrl}?state=${state}`);
|
|
}
|
|
}
|
|
const to_uri = `${baseUrl}/api/auth?appid=${appid}&response_type=code&redirect_uri=${backUrl}#wechat`;
|
|
const to_uri = `${baseUrl}/api/auth?appid=${appid}&response_type=code&redirect_uri=${backUrl}#wechat`;
|
|
- console.log(to_uri);
|
|
|
|
this.ctx.redirect(to_uri);
|
|
this.ctx.redirect(to_uri);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -52,7 +51,6 @@ class WeixinAuthService extends AxiosService {
|
|
* @param {Object} query 参数
|
|
* @param {Object} query 参数
|
|
*/
|
|
*/
|
|
async authBack(query) {
|
|
async authBack(query) {
|
|
- console.log(query);
|
|
|
|
const { code, state } = query;
|
|
const { code, state } = query;
|
|
if (!code) throw new BusinessError(ErrorCode.SERVICE_FAULT, '授权未成功');
|
|
if (!code) throw new BusinessError(ErrorCode.SERVICE_FAULT, '授权未成功');
|
|
const req = await this.httpGet('/api/fetch', { code });
|
|
const req = await this.httpGet('/api/fetch', { code });
|