Skip to content

Commit

Permalink
cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
guyan0319 committed May 7, 2020
1 parent 20ed74f commit 4c7fb91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/cookie/cookie.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package cookie

import (
"github.com/garyburd/redigo/redis"
"github.com/gin-gonic/gin"
"github.com/gomodule/redigo/redis"
"go-admin/modules/cache"
"go-admin/public/common"

"strconv"
"time"
)

var CookieName string = "GATOKEN"

var RedisExpire = 86400 * 7
var RedisExpireRepeat = 1200
var RedisRepeatSuf = "ga_redis_repeat_"

//获取cookie
func GetCacheCookie(c *gin.Context) (int64, error) {

Expand Down Expand Up @@ -50,4 +52,4 @@ func SetCacheCookie(c *gin.Context, id int) (err error) {
}
c.SetCookie(CookieName, key, RedisExpire, "/", "", false, true)
return
}
}

0 comments on commit 4c7fb91

Please sign in to comment.