立即初始化
@@ -192,7 +198,8 @@
userName: 'postgres',
password: '',
dbName: 'gva',
- dbPath: ''
+ dbPath: '',
+ template: 'template0'
})
break
case 'oracle':
From 6b652dfd31e872891b7d8594cbed2768a2de08f4 Mon Sep 17 00:00:00 2001
From: xuedinge <781408517@qq.com>
Date: Sun, 16 Mar 2025 06:51:32 +0800
Subject: [PATCH 17/18] =?UTF-8?q?bugfix:mongodb=E6=B2=A1=E6=9C=89=E5=AF=86?=
=?UTF-8?q?=E7=A0=81=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
server/initialize/mongo.go | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/server/initialize/mongo.go b/server/initialize/mongo.go
index d88afaa747..adefb58cfe 100644
--- a/server/initialize/mongo.go
+++ b/server/initialize/mongo.go
@@ -45,7 +45,7 @@ func (m *mongo) Initialization() error {
opts = internal.Mongo.GetClientOptions()
}
ctx := context.Background()
- client, err := qmgo.Open(ctx, &qmgo.Config{
+ config := &qmgo.Config{
Uri: global.GVA_CONFIG.Mongo.Uri(),
Coll: global.GVA_CONFIG.Mongo.Coll,
Database: global.GVA_CONFIG.Mongo.Database,
@@ -53,12 +53,16 @@ func (m *mongo) Initialization() error {
MaxPoolSize: &global.GVA_CONFIG.Mongo.MaxPoolSize,
SocketTimeoutMS: &global.GVA_CONFIG.Mongo.SocketTimeoutMs,
ConnectTimeoutMS: &global.GVA_CONFIG.Mongo.ConnectTimeoutMs,
- Auth: &qmgo.Credential{
+ }
+ if global.GVA_CONFIG.Mongo.Username != "" && global.GVA_CONFIG.Mongo.Password != "" {
+ config.Auth = &qmgo.Credential{
Username: global.GVA_CONFIG.Mongo.Username,
Password: global.GVA_CONFIG.Mongo.Password,
AuthSource: global.GVA_CONFIG.Mongo.AuthSource,
- },
- }, opts...)
+ }
+ }
+ client, err := qmgo.Open(ctx, config, opts...)
+
if err != nil {
return errors.Wrap(err, "链接mongodb数据库失败!")
}
From cb189b92152383973dafeec4958faac14aa49598 Mon Sep 17 00:00:00 2001
From: xuedinge <781408517@qq.com>
Date: Tue, 29 Apr 2025 19:03:19 +0800
Subject: [PATCH 18/18] chore: .gitattributes
---
.gitattributes | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.gitattributes b/.gitattributes
index a4970acdb6..6037928443 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,14 @@
*.sql linguist-language=GO
*.html linguist-language=GO
+
+*.png binary
+*.jpg binary
+*.jpeg binary
+*.gif binary
+*.ico binary
+*.webp binary
+*.ttf binary
+*.eot binary
+*.woff binary
+*.woff2 binary
+*.otf binary
\ No newline at end of file