From cc7981229cf6805c14058ac42740261a6d4b858c Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:06:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20redis=20=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AF=86=E7=A0=81=E6=83=85=E5=86=B5=E4=B8=8B=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=BA=94=E7=94=A8=E6=B2=A1=E6=9C=89=E5=85=B3=E8=81=94?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#6173)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #6174 --- backend/app/service/app_utils.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index 06835b0ff..677df9ea3 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -186,17 +186,18 @@ func createLink(ctx context.Context, app model.App, appInstall *model.AppInstall } case constant.AppRedis: if password, ok := params["PANEL_REDIS_ROOT_PASSWORD"]; ok { - if password != "" { - authParam := dto.RedisAuthParam{ - RootPassword: password.(string), - } - authByte, err := json.Marshal(authParam) - if err != nil { - return err - } - appInstall.Param = string(authByte) + authParam := dto.RedisAuthParam{ + RootPassword: "", } - database.Password = password.(string) + if password != "" { + authParam.RootPassword = password.(string) + database.Password = password.(string) + } + authByte, err := json.Marshal(authParam) + if err != nil { + return err + } + appInstall.Param = string(authByte) } } if err := databaseRepo.Create(ctx, database); err != nil {