Просмотр исходного кода

更新配置文件,修改数据库连接信息和端口设置

caipin 3 месяцев назад
Родитель
Сommit
be4395cd12
4 измененных файлов с 15 добавлено и 12 удалено
  1. 5 5
      web/config-debug.yaml
  2. 1 1
      web/config-pro.yaml
  3. 1 1
      web/config-uat.yaml
  4. 8 5
      web/main.go

+ 5 - 5
web/config-debug.yaml

@@ -1,5 +1,5 @@
-host: "192.168.1.76"
-port: 3306
-user: "zh_dev"
-pwd: "zongheng2019"
-datebase: "construction"
+host: "47.94.96.130"
+port: 5077
+user: "zh_calc"
+pwd: "zh@)!(3850calc"
+datebase: "construction_uat"

+ 1 - 1
web/config-pro.yaml

@@ -1,4 +1,4 @@
-host: "47.106.95.114"
+host: "127.0.0.1"
 port: 3306
 user: "zh_calc"
 pwd: "zh@)!(3850calc"

+ 1 - 1
web/config-uat.yaml

@@ -1,4 +1,4 @@
-host: "47.106.95.114"
+host: "127.0.0.1"
 port: 3306
 user: "zh_calc"
 pwd: "zh@)!(3850calc"

+ 8 - 5
web/main.go

@@ -12,6 +12,7 @@ import (
 	"go.mod/bootstrap"
 	"go.mod/web/middleware/identity"
 	"go.mod/web/routes"
+	"go.mod/web/utils"
 
 	//_ "go.mod/web/docs"
 
@@ -19,14 +20,9 @@ import (
 	"github.com/iris-contrib/swagger/v12/swaggerFiles" // swagger embed files
 )
 
-var port = 6060
-
 func newApp() *bootstrap.Bootstrapper {
-	// 初始化应用
-
 	app := bootstrap.New("工程建设项目系统", "纵横软件")
 	app.Bootstrap()
-	//, csrf.Configure
 	app.Configure(identity.Configure, routes.Configure)
 
 	return app
@@ -57,5 +53,12 @@ func main() {
 
 	app.Get("/swagger/{any:path}", swagger.CustomWrapHandler(config, swaggerFiles.Handler))
 
+	// 由于新的项目管理服务器的数据库访问权限的问题,这里docker使用了host模式,启动端口需要区分
+	var port = 6070
+	debug := utils.GetEnvInfo("DEBUG")
+	if debug == "uat" {
+		port = 6060
+	}
+
 	app.Listen(fmt.Sprintf(":%d", port))
 }