🆕新增tui管理模式[能用就行]

This commit is contained in:
coward
2024-12-24 16:35:57 +08:00
parent 014c97f877
commit b245c26515
17 changed files with 1475 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import (
"gitee.ltd/lxh/logger/log"
"github.com/cowardmrx/go_aliyun_oss"
"github.com/fsnotify/fsnotify"
"github.com/gin-gonic/gin"
"github.com/glebarez/sqlite"
"github.com/go-resty/resty/v2"
"github.com/redis/go-redis/v9"
@@ -15,6 +16,7 @@ import (
"gorm.io/driver/postgres"
"gorm.io/gorm"
gl "gorm.io/gorm/logger"
"os"
"time"
"wireguard-ui/config"
"wireguard-ui/global/client"
@@ -140,8 +142,14 @@ func initOSS() {
// initLogger
// @description: 初始化日志
func initLogger() {
mode := logger.Dev
if os.Getenv("GIN_MODE") == gin.ReleaseMode {
mode = logger.Prod
}
logger.InitLogger(logger.LogConfig{
Mode: logger.Dev,
Mode: mode,
FileEnable: true,
})
}