xingzai hace 1 año
padre
commit
74ac8e4add
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      controllers/activity_sign.go

+ 6 - 1
controllers/activity_sign.go

@@ -6,6 +6,7 @@ import (
 	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/utils"
 	"strconv"
+	"strings"
 	"time"
 )
 
@@ -267,7 +268,7 @@ func (this *ActivitySignCoAntroller) ByHand() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	if user.Mobile == "" {
+	if user.Mobile == "" && user.Email == "" {
 		if signinType == 1 {
 			if req.Mobile == "" {
 				br.Msg = "参数错误"
@@ -319,6 +320,10 @@ func (this *ActivitySignCoAntroller) ByHand() {
 			}
 		}
 	}
+	//如果是用邮箱登录的,就把手机号置空
+	if strings.Contains(Mobile, "@") {
+		Mobile = ""
+	}
 	item.ActivityId = activityId
 	item.UserId = user.UserId
 	item.Mobile = Mobile