优化代码
This commit is contained in:
parent
e349aecb75
commit
568e774d80
@ -62,7 +62,7 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
string configId = config.ConfigId;
|
string configId = config.ConfigId;
|
||||||
db.GetConnectionScope(configId).Aop.OnLogExecuting = (sql, pars) =>
|
db.GetConnectionScope(configId).Aop.OnLogExecuting = (sql, pars) =>
|
||||||
{
|
{
|
||||||
string log = $"【sql语句】{UtilMethods.GetSqlString(config.DbType, sql, pars)}\n";
|
string log = $"【db{configId} SQL语句】{UtilMethods.GetSqlString(config.DbType, sql, pars)}\n";
|
||||||
if (sql.StartsWith("SELECT", StringComparison.OrdinalIgnoreCase))
|
if (sql.StartsWith("SELECT", StringComparison.OrdinalIgnoreCase))
|
||||||
logger.Info(log);
|
logger.Info(log);
|
||||||
if (sql.StartsWith("UPDATE", StringComparison.OrdinalIgnoreCase) || sql.StartsWith("INSERT", StringComparison.OrdinalIgnoreCase))
|
if (sql.StartsWith("UPDATE", StringComparison.OrdinalIgnoreCase) || sql.StartsWith("INSERT", StringComparison.OrdinalIgnoreCase))
|
||||||
|
|||||||
@ -11,10 +11,10 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
{
|
{
|
||||||
Console.ForegroundColor = ConsoleColor.Blue;
|
Console.ForegroundColor = ConsoleColor.Blue;
|
||||||
var contentTpl = JnHelper.ReadTemplate("", "logo.txt");
|
var contentTpl = JnHelper.ReadTemplate("", "logo.txt");
|
||||||
var content = contentTpl.Render();
|
var content = contentTpl?.Render();
|
||||||
|
|
||||||
Console.WriteLine(content);
|
Console.WriteLine(content);
|
||||||
Console.ForegroundColor = ConsoleColor.Red;
|
Console.ForegroundColor = ConsoleColor.Blue;
|
||||||
Console.WriteLine("源码地址: https://gitee.com/izory/ZrAdminNetCore");
|
Console.WriteLine("源码地址: https://gitee.com/izory/ZrAdminNetCore");
|
||||||
Console.WriteLine("官方文档:http://www.izhaorui.cn/doc");
|
Console.WriteLine("官方文档:http://www.izhaorui.cn/doc");
|
||||||
Console.WriteLine("打赏作者:http://www.izhaorui.cn/doc/support.html");
|
Console.WriteLine("打赏作者:http://www.izhaorui.cn/doc/support.html");
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
|
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
|
||||||
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
|
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
|
||||||
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" backgroundColor="White" />
|
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" backgroundColor="White" />
|
||||||
<highlight-word regex="sql语句" foregroundColor="Red" />
|
<highlight-word regex="SQL语句" foregroundColor="Blue" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="console" xsi:type="ColoredConsole"
|
<target name="console" xsi:type="ColoredConsole"
|
||||||
|
|||||||
@ -20,6 +20,8 @@ namespace ZR.Common
|
|||||||
{
|
{
|
||||||
return Engine.LoadTemplate(fullName);
|
return Engine.LoadTemplate(fullName);
|
||||||
}
|
}
|
||||||
|
Console.ForegroundColor = ConsoleColor.Red;
|
||||||
|
Console.WriteLine($"未找到路径{fullName}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user