yjp 1 жил өмнө
parent
commit
ce8b30b738
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      sql/sql_tpl/value.go

+ 5 - 0
sql/sql_tpl/value.go

@@ -3,6 +3,7 @@ package sql_tpl
 import (
 	"errors"
 	"git.sxidc.com/go-tools/utils/encoding"
+	"git.sxidc.com/go-tools/utils/strutils"
 	"reflect"
 	"strconv"
 	"time"
@@ -16,6 +17,10 @@ type AfterParsedStrValueOption func(strValue string) (string, error)
 
 func WithAESKey(aesKey string) AfterParsedStrValueOption {
 	return func(strValue string) (string, error) {
+		if strutils.IsStringEmpty(strValue) {
+			return strValue, nil
+		}
+
 		encrypted, err := encoding.AESEncrypt(strValue, aesKey)
 		if err != nil {
 			return "", err