|
|
@ -29,12 +29,11 @@ func (t *UserCtl) EntryLogin() { |
|
|
|
activityId := t.MustGetInt("activity_id") // 需要获取
|
|
|
|
|
|
|
|
entry := new(models.OrderEntryPerson) |
|
|
|
exist, err := entry.Auth(account, password, activityId) |
|
|
|
err := entry.Auth(account, password, activityId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_ENTRYPEOPLE_NOT_EXIST, "录入人员不存在") |
|
|
|
|
|
|
|
activity := new(models.Activity) |
|
|
|
exist, err = activity.Get(activity, activityId) |
|
|
|
exist, err := activity.Get(activity, activityId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
|
|
|
|
@ -123,16 +122,20 @@ func (t *UserCtl) WxLogin() { |
|
|
|
t.CheckErr(err) |
|
|
|
|
|
|
|
// 校验邀请函是否开启
|
|
|
|
//invitation := new(models.Invitation)
|
|
|
|
//exist, err = invitation.GetInvitationByActivityId(activityId)
|
|
|
|
//t.CheckErr(err)
|
|
|
|
////t.Assert(exist, code.MSG_INVITE_SETTING_NOT_EXIST, "邀请函设置不存在")
|
|
|
|
//if exist { // 存在邀请函
|
|
|
|
// letter := new(models.InvitationLetter)
|
|
|
|
// exist, err = letter.GetByUserIdAndActivityId(user.Id, activity.Id, activity.ArchId, activity.RehearsalId)
|
|
|
|
// t.CheckErr(err)
|
|
|
|
// t.Assert(exist, code.MSG_INVITE_LETTER_NOT_EXIST, "您尚未接受过邀请")
|
|
|
|
//}
|
|
|
|
var requireInvite = true |
|
|
|
invitation := new(models.Invitation) |
|
|
|
exist, err = invitation.GetInvitationByActivityId(activityId) |
|
|
|
t.CheckErr(err) |
|
|
|
//t.Assert(exist, code.MSG_INVITE_SETTING_NOT_EXIST, "邀请函设置不存在")
|
|
|
|
if exist { // 存在邀请函
|
|
|
|
letter := new(models.InvitationLetter) |
|
|
|
exist, err = letter.GetByUserIdAndActivityId(user.Id, activity.Id, activity.ArchId, activity.RehearsalId) |
|
|
|
t.CheckErr(err) |
|
|
|
if !exist { |
|
|
|
requireInvite = false |
|
|
|
} |
|
|
|
//t.Assert(exist, code.MSG_INVITE_LETTER_NOT_EXIST, "您尚未接受过邀请")
|
|
|
|
} |
|
|
|
|
|
|
|
sign := new(models.SignUp) |
|
|
|
exist, err = sign.GetByActivityId(activityId) |
|
|
@ -178,6 +181,7 @@ func (t *UserCtl) WxLogin() { |
|
|
|
"real_sign_form": sign.RealSignJsonForm, |
|
|
|
"real_sign_json": sign.RealSignJsonTitle, |
|
|
|
"tag": "activity", |
|
|
|
"require_invite": requireInvite, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@ -195,9 +199,9 @@ func (t *UserCtl) Login() { |
|
|
|
exist, err = models.Get(area, areaId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "此直播间已被删除") |
|
|
|
if activity.MoreAreaMode == define.StatusClose && area.IsMainArea != 1 { |
|
|
|
t.ERROR("多地区功能关闭,链接失效,请打开后再试", code.MSG_AREASTORE_CLOSED) |
|
|
|
} |
|
|
|
//if activity.MoreAreaMode == define.StatusClose && area.IsMainArea != 1 {
|
|
|
|
// t.ERROR("多地区功能关闭,链接失效,请打开后再试", code.MSG_AREASTORE_CLOSED)
|
|
|
|
//}
|
|
|
|
|
|
|
|
token, err := wechat.GetToken(wxcode) |
|
|
|
t.CheckErr(err) |
|
|
@ -248,8 +252,6 @@ func (t *UserCtl) Login() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//jwtToken, err := jwt.GenJwtToken(define.TYPE_USER, user.Id, 0, 0, 0, 0)
|
|
|
|
//t.CheckErr(err)
|
|
|
|
user.Token = fmt.Sprintf("%s:%s", define.TYPE_LIVEUSER, user.Token) |
|
|
|
t.SetSession(define.TOKEN, user.Token) |
|
|
|
sign, err := im.AccountImport(fmt.Sprintf("%d", user.Id), user.Nickname, user.Avatar) |
|
|
|