Add classification annotations

This commit is contained in:
2025-10-27 23:12:15 +08:00
parent 3990ec01c6
commit 5aacb88c22
44 changed files with 2769 additions and 2241 deletions

View File

@@ -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
}
}