rdluck 4 years ago
parent
commit
fe96f96041
2 changed files with 11 additions and 1 deletions
  1. 5 1
      controllers/article.go
  2. 6 0
      controllers/wechat.go

+ 5 - 1
controllers/article.go

@@ -75,7 +75,11 @@ func (this *ArticleController) Detail() {
 		detail.Body = html.UnescapeString(detail.Body)
 		detail.Abstract = html.UnescapeString(detail.Abstract)
 		if companyPermission == "" {
-			hasPermission = 2
+			if applyCount > 0 {
+				hasPermission = 5
+			} else {
+				hasPermission = 2
+			}
 			hasFree = 2
 			goto Loop
 		} else {

+ 6 - 0
controllers/wechat.go

@@ -201,6 +201,12 @@ func (this *WechatCommonController) WechatLogin() {
 		return
 	}
 
+	if token == "" {
+		br.Msg = "微信登录失败"
+		br.ErrMsg = "token:" + token + "" + code + " " + wxInfo.OpenID + " " + wxInfo.UnionID
+		return
+	}
+
 	//新增登录日志
 	{
 		loginLog := new(models.WxUserLog)