Feat: captcha

This commit is contained in:
HFO4
2019-11-13 17:03:55 +08:00
parent c7e47293db
commit 7d4e212d4e
6 changed files with 74 additions and 2 deletions

View File

@@ -14,6 +14,19 @@ func SetSession(c *gin.Context, list map[string]interface{}) {
s.Save()
}
// GetSession 获取session
func GetSession(c *gin.Context, key string) interface{} {
s := sessions.Default(c)
return s.Get(key)
}
// DeleteSession 删除session
func DeleteSession(c *gin.Context, key string) {
s := sessions.Default(c)
s.Delete(key)
s.Save()
}
// ClearSession 清空session
func ClearSession(c *gin.Context) {
s := sessions.Default(c)