Skip to content

Commit

Permalink
Web api bug
Browse files Browse the repository at this point in the history
  • Loading branch information
刘河 committed Mar 5, 2019
1 parent 149b2e4 commit d45bc3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/controllers/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (s *BaseController) Prepare() {
md5Key := s.GetString("auth_key")
timestamp := s.GetIntNoErr("timestamp")
configKey := beego.AppConfig.String("authKey")
if !(time.Now().Unix()-int64(timestamp) < 20 && time.Now().Unix()-int64(timestamp) > 0 && crypt.Md5(configKey+strconv.Itoa(timestamp)) == md5Key) {
if !(time.Now().Unix()-int64(timestamp) <= 20 && time.Now().Unix()-int64(timestamp) >= 0 && crypt.Md5(configKey+strconv.Itoa(timestamp)) == md5Key) {
if s.GetSession("auth") != true {
s.Redirect("/login/index", 302)
}
Expand Down

0 comments on commit d45bc3c

Please sign in to comment.