Browse Source

fix:bug

token_replace
Tooooommy 4 years ago
parent
commit
c3747b0748
  1. 6
      controllers/client/login.go
  2. 7
      controllers/client/sign.go
  3. 2
      utils/code/code.go

6
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")

7
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)

2
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 // 直播不存在

Loading…
Cancel
Save