config.go 454 B

123456789101112131415161718192021222324252627
  1. package utils
  2. import (
  3. beeLogger "github.com/beego/bee/v2/logger"
  4. "github.com/beego/beego/v2/server/web"
  5. )
  6. var (
  7. RunMode string //运行模式
  8. MYSQL_URL string //数据库连接
  9. )
  10. func init() {
  11. tmpRunMode, err := web.AppConfig.String("run_mode")
  12. if err != nil {
  13. panic("配置文件读取run_mode错误 " + err.Error())
  14. }
  15. RunMode = tmpRunMode
  16. beeLogger.Log.Info(RunMode + " 模式")
  17. if RunMode == "release" {
  18. } else {
  19. }
  20. }