🎉 初始化项目

This commit is contained in:
2026-03-03 06:05:51 +08:00
commit e1c70fe218
241 changed files with 148285 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package common
import (
"github.com/gin-gonic/gin"
)
// GetAppUserID 从上下文获取前台用户 ID
func GetAppUserID(c *gin.Context) uint {
if userID, exists := c.Get("appUserId"); exists {
return userID.(uint)
}
return 0
}
// GetAppUsername 从上下文获取前台用户名
func GetAppUsername(c *gin.Context) string {
if username, exists := c.Get("appUsername"); exists {
return username.(string)
}
return ""
}