浏览代码

fix:WX session修改

duxin 3 年之前
父节点
当前提交
1dda0ae6c9
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/jfw/front/frontRouter.go

+ 3 - 0
src/jfw/front/frontRouter.go

@@ -71,6 +71,9 @@ func (this *CommonRouter) WxCommonPage(folder, loginSign, htmlPage string) error
 				return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), stateKey), 302)
 			}
 			openid = jyutil.Getopenid(this.GetString("code"))
+			if ok, _, _ := FindUserAndCreateSess(openid, this.Session(), "wx", false); !ok {
+				return this.Redirect("/swordfish/about")
+			}
 		}
 		if !CheckUserIsSubscribe(openid) {
 			return this.Redirect("/swordfish/about")