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.

112 lines
2.5 KiB

  1. #! /bin/bash
  2. rm -f ./core/server.go
  3. # 生成server.go文件, 添加Router.Static("/admin", "./resource/dist")这个代码
  4. touch ./core/server.go
  5. filename="./core/server.go"
  6. cat>"${filename}"<<EOF
  7. package core
  8. import (
  9. "fmt"
  10. "gin-vue-admin/global"
  11. "gin-vue-admin/initialize"
  12. "time"
  13. )
  14. type server interface {
  15. ListenAndServe() error
  16. }
  17. func RunWindowsServer() {
  18. if global.GVA_CONFIG.System.UseMultipoint {
  19. // 初始化redis服务
  20. initialize.Redis()
  21. }
  22. Router := initialize.Routers()
  23. Router.Static("/form-generator", "./resource/page")
  24. Router.Static("/admin", "./resource/dist")
  25. //InstallPlugs(Router)
  26. // end 插件描述
  27. address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
  28. s := initServer(address, Router)
  29. // 保证文本顺序输出
  30. // In order to ensure that the text order output can be deleted
  31. time.Sleep(10 * time.Microsecond)
  32. global.GVA_LOG.Debug("server run success on ", address)
  33. fmt.Printf("欢迎使用 Gin-Vue-Admin默认自动化文档地址:http://127.0.0.1%s/swagger/index.html\n 默认前端文件运行地址:http://127.0.0.1:8888/admin\n", address)
  34. global.GVA_LOG.Error(s.ListenAndServe())
  35. }
  36. EOF
  37. rm -f ./config.yaml
  38. # 生成config.yaml文件, 用于docker-compose的使用
  39. touch ./config.yaml
  40. filename="./config.yaml"
  41. cat>"${filename}"<<EOF
  42. # Gin-Vue-Admin Global Configuration
  43. # casbin configuration
  44. casbin:
  45. model-path: './resource/rbac_model.conf'
  46. # jwt configuration
  47. jwt:
  48. signing-key: 'qmPlus'
  49. # mysql connect configuration
  50. mysql:
  51. username: root
  52. password: 'Aa@6447985'
  53. path: mysql
  54. db-name: 'qmPlus'
  55. config: 'charset=utf8&parseTime=True&loc=Local'
  56. max-idle-conns: 10
  57. max-open-conns: 10
  58. log-mode: true
  59. #sqlite 配置
  60. sqlite:
  61. path: db.db
  62. log-mode: true
  63. config: 'loc=Asia/Shanghai'
  64. # oss configuration
  65. # 请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址
  66. qiniu:
  67. access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ'
  68. secret-key: 'pgdbqEsf7ooZh7W3xokP833h3dZ_VecFXPDeG5JY'
  69. bucket: 'qm-plus-img'
  70. img-path: 'http://qmplusimg.henrongyi.top'
  71. # redis configuration
  72. redis:
  73. addr: redis:6379
  74. password: ''
  75. db: 0
  76. # system configuration
  77. system:
  78. use-multipoint: true
  79. env: 'public' # Change to "develop" to skip authentication for development mode
  80. addr: 8888
  81. db-type: "mysql" # support mysql/sqlite
  82. # captcha configuration
  83. captcha:
  84. key-long: 6
  85. img-width: 240
  86. img-height: 80
  87. # logger configuration
  88. log:
  89. prefix: '[GIN-VUE-ADMIN]'
  90. log-file: true
  91. stdout: 'DEBUG'
  92. file: 'DEBUG'
  93. EOF