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.

118 lines
2.7 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=utf8mb4&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. # 切换本地与七牛云上传,分配头像和文件路径
  66. localupload:
  67. local: false
  68. avatar-path: uploads/avatar
  69. file-path: uploads/file
  70. # 请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址
  71. qiniu:
  72. access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ'
  73. secret-key: 'pgdbqEsf7ooZh7W3xokP833h3dZ_VecFXPDeG5JY'
  74. bucket: 'qm-plus-img'
  75. img-path: 'http://qmplusimg.henrongyi.top'
  76. # redis configuration
  77. redis:
  78. addr: redis:6379
  79. password: ''
  80. db: 0
  81. # system configuration
  82. system:
  83. use-multipoint: true
  84. env: 'public' # Change to "develop" to skip authentication for development mode
  85. addr: 8888
  86. db-type: "mysql" # support mysql/sqlite
  87. # captcha configuration
  88. captcha:
  89. key-long: 6
  90. img-width: 240
  91. img-height: 80
  92. # logger configuration
  93. log:
  94. prefix: '[GIN-VUE-ADMIN]'
  95. log-file: true
  96. stdout: 'DEBUG'
  97. file: 'DEBUG'
  98. EOF