|
|
@ -4,10 +4,13 @@ import ( |
|
|
|
"fmt" |
|
|
|
"gin-vue-admin/global" |
|
|
|
"gin-vue-admin/initialize" |
|
|
|
"net/http" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
type server interface { |
|
|
|
ListenAndServe() error |
|
|
|
} |
|
|
|
|
|
|
|
func RunWindowsServer() { |
|
|
|
if global.GVA_CONFIG.System.UseMultipoint { |
|
|
|
// 初始化redis服务
|
|
|
@ -20,13 +23,7 @@ func RunWindowsServer() { |
|
|
|
// end 插件描述
|
|
|
|
|
|
|
|
address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr) |
|
|
|
s := &http.Server{ |
|
|
|
Addr: address, |
|
|
|
Handler: Router, |
|
|
|
ReadTimeout: 10 * time.Second, |
|
|
|
WriteTimeout: 10 * time.Second, |
|
|
|
MaxHeaderBytes: 1 << 20, |
|
|
|
} |
|
|
|
s := initServer(address, Router) |
|
|
|
// 保证文本顺序输出
|
|
|
|
// In order to ensure that the text order output can be deleted
|
|
|
|
time.Sleep(10 * time.Microsecond) |
|
|
@ -35,6 +32,6 @@ func RunWindowsServer() { |
|
|
|
fmt.Printf(`欢迎使用 Gin-Vue-Admin |
|
|
|
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
|
|
|
|
默认前端文件运行地址:http://127.0.0.1:8080
|
|
|
|
`, s.Addr) |
|
|
|
`, address) |
|
|
|
global.GVA_LOG.Error(s.ListenAndServe()) |
|
|
|
} |