Skip to content

Commit

Permalink
fix: mysql 绑定用户增加输入校验 (#6149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu authored Aug 16, 2024
1 parent 779addf commit 1b92b6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/app/service/database_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b92b6c

Please sign in to comment.