From 78209ed65dde587c689bc4615dccc401045a2969 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Thu, 16 Jan 2020 12:38:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QMPlusServer/cmd/linux.go | 32 -------------------------------- QMPlusServer/main.go | 3 ++- 2 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 QMPlusServer/cmd/linux.go 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系统