Browse Source

Update json 2 sql ToCheckField

pull/40/head
sunkaixuan 1 year ago
parent
commit
9b251b59f1
  1. 10
      Src/Asp.NetCore2/SqlSugar/Utilities/DbExtensions.cs

10
Src/Asp.NetCore2/SqlSugar/Utilities/DbExtensions.cs

@ -68,7 +68,7 @@ namespace SqlSugar
{ {
if (value != null) if (value != null)
{ {
if (value.IsContainsIn(";", "--")) if (value.IsContainsIn(";", "--"))
{ {
throw new Exception($"{value} format error "); throw new Exception($"{value} format error ");
} }
@ -76,6 +76,14 @@ namespace SqlSugar
{ {
throw new Exception($"{value} format error "); throw new Exception($"{value} format error ");
} }
else if (value.ToLower().Contains(" update ")
|| value.ToLower().Contains(" delete ")
|| value.ToLower().Contains(" drop ")
|| value.ToLower().Contains(" alert ")
|| value.ToLower().Contains(" create "))
{
Check.ExceptionEasy($"{value} format error ", value+ "不能存在 空格+【update drop 等】+空格 ");
}
} }
return value; return value;
} }

Loading…
Cancel
Save