You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

4 years ago
  1. package core
  2. import (
  3. "fmt"
  4. "gin-vue-admin/global"
  5. "gin-vue-admin/initialize"
  6. "go.uber.org/zap"
  7. "time"
  8. )
  9. type server interface {
  10. ListenAndServe() error
  11. }
  12. func RunWindowsServer() {
  13. if global.GVA_CONFIG.System.UseMultipoint {
  14. // 初始化redis服务
  15. initialize.Redis()
  16. }
  17. initialize.InitWkMode()
  18. Router := initialize.Routers()
  19. Router.Static("/form-generator", "./resource/page")
  20. address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
  21. s := initServer(address, Router)
  22. // 保证文本顺序输出
  23. // In order to ensure that the text order output can be deleted
  24. time.Sleep(10 * time.Microsecond)
  25. global.GVA_LOG.Info("server run success on ", zap.String("address", address))
  26. fmt.Printf(`
  27. 欢迎使用 Gin-Vue-Admin
  28. 当前版本:V2.3.8
  29. 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
  30. 默认前端文件运行地址:http://127.0.0.1:8080
  31. 如果项目让您获得了收益希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee
  32. `, address)
  33. global.GVA_LOG.Error(s.ListenAndServe().Error())
  34. }