From 1b92b6cbfad7139321ab9c83b1f9563da8641072 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:00:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20mysql=20=E7=BB=91=E5=AE=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=A2=9E=E5=8A=A0=E8=BE=93=E5=85=A5=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=20(#6149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/database_mysql.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/app/service/database_mysql.go b/backend/app/service/database_mysql.go index 06feef640..b93cf16a4 100644 --- a/backend/app/service/database_mysql.go +++ b/backend/app/service/database_mysql.go @@ -141,6 +141,10 @@ func (u *MysqlService) Create(ctx context.Context, req dto.MysqlDBCreate) (*mode } func (u *MysqlService) BindUser(req dto.BindUser) error { + if cmd.CheckIllegal(req.Username, req.Password, req.Permission) { + return buserr.New(constant.ErrCmdIllegal) + } + dbItem, err := mysqlRepo.Get(mysqlRepo.WithByMysqlName(req.Database), commonRepo.WithByName(req.DB)) if err != nil { return err