|
@@ -26,6 +26,7 @@ module.exports = app => {
|
|
|
ctx.redirect('/wap');
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
const errorMessage = ctx.session.loginError;
|
|
|
// 显示完删除
|
|
|
ctx.session.loginError = null;
|
|
@@ -53,7 +54,7 @@ module.exports = app => {
|
|
|
async wxAuth(ctx) {
|
|
|
const code = ctx.query.code;
|
|
|
try {
|
|
|
- const client = new OAuth('wx5320cd30cecdbd68', 'ca7c0dbd9e94dc3b1c3b0e73865743f4');
|
|
|
+ const client = new OAuth(ctx.app.config.wxCode.appid, ctx.app.config.wxCode.appsecret);
|
|
|
const token = await client.getAccessToken(code);
|
|
|
// const user = await client.getUser(token.data.openid);
|
|
|
// console.log(user);
|
|
@@ -308,7 +309,7 @@ module.exports = app => {
|
|
|
ctx.redirect('/dashboard');
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- this.log(error);
|
|
|
+ // this.log(error);
|
|
|
ctx.session.loginError = error;
|
|
|
}
|
|
|
const errorMessage = ctx.session.loginError;
|