From 687b7e9c38eebda31b2b5608eb81aa1146b062d1 Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Tue, 17 Dec 2024 11:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E1=E3=80=81=E8=B0=83=E6=95=B4sql?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E6=89=93=E5=8D=B0=E8=8C=83=E5=9B=B4=20=202?= =?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0mdEditor=E7=BB=84=E4=BB=B6=20=204?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E5=90=8E=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=20=205=E3=80=81?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin.NET.Core/Admin.NET.Core.csproj | 2 +- .../Admin.NET.Core/SqlSugar/SqlSugarSetup.cs | 41 ++++++----- Web/package.json | 10 +-- Web/src/components/mdEditor/index.vue | 73 +++++++++++++++++++ .../system/user/component/changePassword.vue | 14 +--- 5 files changed, 104 insertions(+), 36 deletions(-) create mode 100644 Web/src/components/mdEditor/index.vue diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj index 18778c3c..c23ee019 100644 --- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj +++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj @@ -46,7 +46,7 @@ - + diff --git a/Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs b/Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs index 1d9a8a8d..e0b19915 100644 --- a/Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs +++ b/Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs @@ -158,27 +158,28 @@ public static class SqlSugarSetup Console.ForegroundColor = originColor; App.PrintToMiniProfiler("SqlSugar", "Info", log); }; - db.Aop.OnLogExecuted = (sql, pars) => - { - //// 若参数值超过100个字符则进行截取 - //foreach (var par in pars) - //{ - // if (par.DbType != System.Data.DbType.String || par.Value == null) continue; - // if (par.Value.ToString().Length > 100) - // par.Value = string.Concat(par.Value.ToString()[..100], "......"); - //} - - // 执行时间超过5秒时 - if (db.Ado.SqlExecutionTime.TotalSeconds <= 5) return; - - var fileName = db.Ado.SqlStackTrace.FirstFileName; // 文件名 - var fileLine = db.Ado.SqlStackTrace.FirstLine; // 行号 - var firstMethodName = db.Ado.SqlStackTrace.FirstMethodName; // 方法名 - var log = $"【{DateTime.Now}——超时SQL】\r\n【所在文件名】:{fileName}\r\n【代码行数】:{fileLine}\r\n【方法名】:{firstMethodName}\r\n" + $"【SQL语句】:{UtilMethods.GetNativeSql(sql, pars)}"; - Log.Warning(log); - App.PrintToMiniProfiler("SqlSugar", "Slow", log); - }; } + db.Aop.OnLogExecuted = (sql, pars) => + { + //// 若参数值超过100个字符则进行截取 + //foreach (var par in pars) + //{ + // if (par.DbType != System.Data.DbType.String || par.Value == null) continue; + // if (par.Value.ToString().Length > 100) + // par.Value = string.Concat(par.Value.ToString()[..100], "......"); + //} + + // 执行时间超过5秒时 + if (db.Ado.SqlExecutionTime.TotalSeconds <= 5) return; + + var fileName = db.Ado.SqlStackTrace.FirstFileName; // 文件名 + var fileLine = db.Ado.SqlStackTrace.FirstLine; // 行号 + var firstMethodName = db.Ado.SqlStackTrace.FirstMethodName; // 方法名 + var log = $"【{DateTime.Now}——超时SQL】\r\n【所在文件名】:{fileName}\r\n【代码行数】:{fileLine}\r\n【方法名】:{firstMethodName}\r\n" + $"【SQL语句】:{UtilMethods.GetNativeSql(sql, pars)}"; + Log.Warning(log); + App.PrintToMiniProfiler("SqlSugar", "Slow", log); + }; + // 数据审计 db.Aop.DataExecuting = (oldValue, entityInfo) => { diff --git a/Web/package.json b/Web/package.json index 13b55d56..0186ffba 100644 --- a/Web/package.json +++ b/Web/package.json @@ -2,7 +2,7 @@ "name": "admin.net.pro", "type": "module", "version": "2.4.33", - "lastBuildTime": "2024.12.16", + "lastBuildTime": "2024.12.17", "description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架", "author": "zuohuaijun", "license": "MIT", @@ -45,7 +45,7 @@ "jsplumb": "^2.15.6", "jwchat": "^2.0.3", "lodash-es": "^4.17.21", - "md-editor-v3": "^5.1.0", + "md-editor-v3": "^5.1.1", "mitt": "^3.0.1", "monaco-editor": "^0.52.2", "mqtt": "^5.10.3", @@ -74,7 +74,7 @@ "vue-router": "^4.5.0", "vue-signature-pad": "^3.0.2", "vue3-tree-org": "^4.2.2", - "vxe-pc-ui": "^4.3.34", + "vxe-pc-ui": "^4.3.35", "vxe-table": "^4.8.10", "vxe-table-plugin-element": "^4.0.4", "vxe-table-plugin-export-xlsx": "^4.0.7", @@ -88,8 +88,8 @@ "@types/node": "^20.17.10", "@types/nprogress": "^0.2.3", "@types/sortablejs": "^1.15.8", - "@typescript-eslint/eslint-plugin": "^8.18.0", - "@typescript-eslint/parser": "^8.18.0", + "@typescript-eslint/eslint-plugin": "^8.18.1", + "@typescript-eslint/parser": "^8.18.1", "@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue-jsx": "^4.1.1", "@vue/compiler-sfc": "^3.5.13", diff --git a/Web/src/components/mdEditor/index.vue b/Web/src/components/mdEditor/index.vue new file mode 100644 index 00000000..796d5a73 --- /dev/null +++ b/Web/src/components/mdEditor/index.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/Web/src/views/system/user/component/changePassword.vue b/Web/src/views/system/user/component/changePassword.vue index fb25a6d5..e90f5dc6 100644 --- a/Web/src/views/system/user/component/changePassword.vue +++ b/Web/src/views/system/user/component/changePassword.vue @@ -42,7 +42,7 @@