@@ -52,8 +52,14 @@ func (c *BaseAuthController) Prepare() {
}
c.User = user
c.Session = session
- if c.User.ValidStartTime.Before(time.Now()) && c.User.ValidEndTime.After(time.Now()) {
+ // 判断正式用户,是否在有效期内
- c.User.Status = utils.UserStatusNo
+ if c.User.Status == utils.UserStatusFormal {
+ if c.User.ValidStartTime.Before(time.Now()) && c.User.ValidEndTime.After(time.Now()) {
+ c.User.Status = utils.UserStatusFormal
+ } else {
+ c.User.Status = utils.UserStatusNo
+ }
+
} else {
c.JSON(models.BaseResponse{Ret: 408, Msg: "请求异常,请联系客服!", ErrMsg: "POST之外的请求,暂不支持"}, false, false)