master
wangshuai 5 years ago
parent 1c42b30108
commit c25b4e2c2b

@ -90,7 +90,8 @@ func Login(c *gin.Context) {
s, _, accessToken := AccountService.CreateAccessToken("TEST_009", time.Now().Format("200601021504"))
if s == true {
c.SetCookie("access_token", accessToken, 3600 * 8, "/", "", false, true)
c.SetCookie("access_token", accessToken, 3600 * 8, "/", "", false, false)
c.SetCookie("access_time", time.Now().Format("200601021504"), 3600 * 8, "/", "", false, false)
}
c.JSON(http.StatusOK, gin.H{
"status" : "ok",
@ -249,10 +250,10 @@ func IsLogin(c *gin.Context) {
sess := globalSessions.SessionStart(w, r)
val := sess.Get("username")
if val != nil {
s, _, accessToken := AccountService.CreateAccessToken("TEST_009", time.Now().Format("200601021504"))
if s == true {
c.SetCookie("access_token", accessToken, 3600 * 8, "/", "", false, true)
}
//s, _, accessToken := AccountService.CreateAccessToken("TEST_009", time.Now().Format("200601021504"))
//if s == true {
// c.SetCookie("access_token", accessToken, 3600 * 8, "/", "", false, false)
//}
c.JSON(http.StatusOK, gin.H{
"status" : true,

Loading…
Cancel
Save