From c3747b0748c3e9590992fcd8ef686b35ac00d016 Mon Sep 17 00:00:00 2001 From: Tooooommy Date: Mon, 28 Sep 2020 14:51:12 +0800 Subject: [PATCH] fix:bug --- controllers/client/login.go | 6 +++--- controllers/client/sign.go | 7 +++++-- utils/code/code.go | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/controllers/client/login.go b/controllers/client/login.go index 2714ba7..482fce8 100644 --- a/controllers/client/login.go +++ b/controllers/client/login.go @@ -176,9 +176,9 @@ func (t *UserCtl) Login() { area := &models.AreaStore{} exist, err = models.Get(area, areaId) t.CheckErr(err) - t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区被删除,链接失效") + t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "此直播间已被删除") if activity.MoreAreaMode == define.StatusClose && area.IsMainArea != 1 { - t.ERROR("多地区功能关闭,链接失效,请打开后再试", code.MSG_AREASTORE_NOT_EXIST) + t.ERROR("多地区功能关闭,链接失效,请打开后再试", code.MSG_AREASTORE_CLOSED) } token, err := wechat.GetToken(wxcode) @@ -215,7 +215,7 @@ func (t *UserCtl) Login() { password := t.MustGet("password") exist, err := area.Login(activityId, username, password) t.CheckErr(err) - t.Assert(exist, code.MSG_ERR_Authority, "不存在地区管理员") + t.Assert(exist, code.MSG_ERR_LOGIN_ERR, "不存在地区管理员") if area.UserId != user.Id { area.UserId = user.Id _, err = models.Update(area.Id, area, "user_id") diff --git a/controllers/client/sign.go b/controllers/client/sign.go index 695bc1f..ff7ebd1 100644 --- a/controllers/client/sign.go +++ b/controllers/client/sign.go @@ -31,10 +31,13 @@ func (t *SignCtl) CheckSign() { t.CheckErr(err) t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") - area := new(models.AreaStore) + area := &models.AreaStore{} exist, err = models.Get(area, areaId) t.CheckErr(err) - t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区不存在") + t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "此直播间已被删除") + if activity.MoreAreaMode == define.StatusClose && area.IsMainArea != 1 { + t.ERROR("多地区功能关闭,链接失效,请打开后再试", code.MSG_AREASTORE_CLOSED) + } if _type == 1 { live := new(models.LiveConfig) diff --git a/utils/code/code.go b/utils/code/code.go index 728fb37..f73cfec 100644 --- a/utils/code/code.go +++ b/utils/code/code.go @@ -4,6 +4,7 @@ const ( MSG_SUCCESS = 0 MSG_DATA_NOT_EXIST = 404 MSG_ERR_Authority = 501 + MSG_ERR_LOGIN_ERR = 502 MSG_ERR_Param = 503 MSG_ERR = 504 MSG_USER_NOT_EXIST = 600 @@ -11,6 +12,7 @@ const ( MSG_USER_DATA_ERROR = 603 MSG_CUSTOMER_NOT_EXIST = 700 MSG_AREASTORE_NOT_EXIST = 800 + MSG_AREASTORE_CLOSED = 801 MSG_ENTRYPEOPLE_NOT_EXIST = 900 MSG_LIVE_LIMIT_ENOUGH = 998 // 直播间人数已满 MSG_LIVE_CONFIG_NOT_EXIST = 999 // 直播不存在