|
@@ -77,7 +77,7 @@ class WeixinController extends Controller {
|
|
|
const val = await this.app.redis.get(key);
|
|
|
const { redirect_uri, type, uid } = JSON.parse(val);
|
|
|
console.log('redirect_uri-->' + redirect_uri);
|
|
|
- if(type === '0'){
|
|
|
+ if (type === '0') {
|
|
|
// 通过openid取得用户信息
|
|
|
const user = await this.ctx.service.user.findByOpenid(openid);
|
|
|
if (user) {
|
|
@@ -92,7 +92,7 @@ class WeixinController extends Controller {
|
|
|
// TODO: 重定性页面
|
|
|
this.ctx.redirect(to_uri);
|
|
|
}
|
|
|
- } elseif(type === '1'){
|
|
|
+ } else if (type === '1') {
|
|
|
const user = await this.ctx.service.user.fetch(uid);
|
|
|
let _type = '';
|
|
|
if (user) {
|
|
@@ -116,7 +116,7 @@ class WeixinController extends Controller {
|
|
|
assert(redirect_uri, '回调地址不能为空');
|
|
|
assert(openid, 'openid不能为空');
|
|
|
|
|
|
- if(type === '0'){
|
|
|
+ if (type === '0') {
|
|
|
// 通过openid取得用户信息
|
|
|
const user = await this.ctx.service.user.findByOpenid(openid);
|
|
|
if (user) {
|
|
@@ -131,7 +131,7 @@ class WeixinController extends Controller {
|
|
|
// TODO: 重定性页面
|
|
|
this.ctx.redirect(to_uri);
|
|
|
}
|
|
|
- } else if(type === '1'){
|
|
|
+ } else if (type === '1') {
|
|
|
const user = await this.ctx.service.user.fetch(uid);
|
|
|
let _type = '';
|
|
|
if (user) {
|