Browse Source

fix: mysql 绑定用户增加输入校验 (#6149)

pull/6172/head
ssongliu 3 months ago committed by GitHub
parent
commit
1b92b6cbfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      backend/app/service/database_mysql.go

4
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

Loading…
Cancel
Save