fix: 解决 redis 没有密码情况下安装应用没有关联的问题 (#6173)

Refs #6174
This commit is contained in:
zhengkunwang 2024-08-19 18:06:42 +08:00 committed by GitHub
parent 3ec208dc85
commit cc7981229c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {