diff --git a/QMPlusServer/cmd/linux.go b/QMPlusServer/cmd/linux.go deleted file mode 100644 index b8e9c1a2..00000000 --- a/QMPlusServer/cmd/linux.go +++ /dev/null @@ -1,32 +0,0 @@ -package cmd - -import ( - "fmt" - "gin-vue-admin/config" - "github.com/fvbock/endless" - "github.com/gin-gonic/gin" - "syscall" - "time" -) - -func RunLinuxServer(Router *gin.Engine) { - endless.DefaultReadTimeOut = 10 * time.Second - endless.DefaultWriteTimeOut = 10 * time.Second - endless.DefaultMaxHeaderBytes = 1 << 20 - endPoint := fmt.Sprintf(":%d", config.GinVueAdminconfig.System.Addr) - - server := endless.NewServer(endPoint, Router) - server.BeforeBegin = func(add string) { - fmt.Printf(`欢迎使用 Gin-Vue-Admin - 作者:奇淼 And Spike666 - 微信:shouzi_1994 - 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html - 默认前端文件运行地址:http://127.0.0.1:8080 - Actual pid is %d -`, fmt.Sprintf(":%d", config.GinVueAdminconfig.System.Addr), syscall.Getpid()) - } - err := server.ListenAndServe() - if err != nil { - fmt.Printf("Server err: %v", err) - } -} diff --git a/QMPlusServer/main.go b/QMPlusServer/main.go index babb994e..5cf19f06 100644 --- a/QMPlusServer/main.go +++ b/QMPlusServer/main.go @@ -32,9 +32,10 @@ func main() { qmlog.QMLog.Info("服务器开启") // 日志测试代码 //Router.RunTLS(":443","ssl.pem", "ssl.key") // https支持 需要添加中间件 sysType := runtime.GOOS + if sysType == "linux" { // LINUX系统 - cmd.RunLinuxServer(Router) + // 借助endless开发无感知重启后台 以及前端接口重启后台功能 } if sysType == "windows" { // WIN系统