mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 10:42:45 +08:00
Add classification annotations
This commit is contained in:
@@ -7,6 +7,10 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// ============================================================================
|
||||
// Cookie创建函数
|
||||
// ============================================================================
|
||||
|
||||
// CreateSecureCookie 创建安全的Cookie
|
||||
// name: Cookie名称
|
||||
// value: Cookie值
|
||||
@@ -67,6 +71,10 @@ func CreateExpiredCookie(name string) *http.Cookie {
|
||||
return CreateSecureCookie(name, "", -1)
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 配置函数
|
||||
// ============================================================================
|
||||
|
||||
// GetDefaultCookieMaxAge 获取默认Cookie过期时间
|
||||
func GetDefaultCookieMaxAge() int {
|
||||
maxAge := viper.GetInt("security.cookie.max_age")
|
||||
@@ -74,4 +82,4 @@ func GetDefaultCookieMaxAge() int {
|
||||
return 86400 // 默认24小时
|
||||
}
|
||||
return maxAge
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user