mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-08 02:14:44 +08:00
🐛fix: 部分服务器晚8个小时问题
This commit is contained in:
@@ -9,13 +9,11 @@
|
||||
],
|
||||
"env": {}
|
||||
},
|
||||
"mysql": {
|
||||
"type": "stdio",
|
||||
"command": "uvx",
|
||||
"openauthpro": {
|
||||
"command": "powershell",
|
||||
"args": [
|
||||
"--from",
|
||||
"mysql-mcp-server",
|
||||
"mysql_mcp_server"
|
||||
"-Command",
|
||||
"npx -y @f4ww4z/mcp-mysql-server"
|
||||
],
|
||||
"env": {
|
||||
"MYSQL_HOST": "localhost",
|
||||
|
||||
117
Infrastructure/Helpers/TimeHelper.cs
Normal file
117
Infrastructure/Helpers/TimeHelper.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
|
||||
namespace Infrastructure.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// 时间处理帮助类
|
||||
/// 统一处理时区问题,确保所有时间都使用正确的时区
|
||||
/// </summary>
|
||||
public static class TimeHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取当前中国标准时间(UTC+8)
|
||||
/// </summary>
|
||||
/// <returns>当前中国标准时间</returns>
|
||||
public static DateTime Now => GetChinaStandardTime();
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前中国标准时间(UTC+8)
|
||||
/// </summary>
|
||||
/// <returns>当前中国标准时间</returns>
|
||||
public static DateTime GetChinaStandardTime()
|
||||
{
|
||||
// 获取UTC时间
|
||||
var utcNow = DateTime.UtcNow;
|
||||
|
||||
// 转换为中国标准时间(UTC+8)
|
||||
var chinaTimeZone = TimeZoneInfo.FindSystemTimeZoneById("China Standard Time");
|
||||
|
||||
// 如果找不到中国时区,使用手动计算(UTC+8)
|
||||
if (chinaTimeZone == null)
|
||||
{
|
||||
return utcNow.AddHours(8);
|
||||
}
|
||||
|
||||
return TimeZoneInfo.ConvertTimeFromUtc(utcNow, chinaTimeZone);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将UTC时间转换为中国标准时间
|
||||
/// </summary>
|
||||
/// <param name="utcTime">UTC时间</param>
|
||||
/// <returns>中国标准时间</returns>
|
||||
public static DateTime ConvertUtcToChinaTime(DateTime utcTime)
|
||||
{
|
||||
if (utcTime.Kind != DateTimeKind.Utc)
|
||||
{
|
||||
utcTime = DateTime.SpecifyKind(utcTime, DateTimeKind.Utc);
|
||||
}
|
||||
|
||||
var chinaTimeZone = TimeZoneInfo.FindSystemTimeZoneById("China Standard Time");
|
||||
|
||||
if (chinaTimeZone == null)
|
||||
{
|
||||
return utcTime.AddHours(8);
|
||||
}
|
||||
|
||||
return TimeZoneInfo.ConvertTimeFromUtc(utcTime, chinaTimeZone);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将中国标准时间转换为UTC时间
|
||||
/// </summary>
|
||||
/// <param name="chinaTime">中国标准时间</param>
|
||||
/// <returns>UTC时间</returns>
|
||||
public static DateTime ConvertChinaTimeToUtc(DateTime chinaTime)
|
||||
{
|
||||
var chinaTimeZone = TimeZoneInfo.FindSystemTimeZoneById("China Standard Time");
|
||||
|
||||
if (chinaTimeZone == null)
|
||||
{
|
||||
return chinaTime.AddHours(-8);
|
||||
}
|
||||
|
||||
return TimeZoneInfo.ConvertTimeToUtc(chinaTime, chinaTimeZone);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前时间的Unix时间戳(秒)
|
||||
/// </summary>
|
||||
/// <returns>Unix时间戳</returns>
|
||||
public static long GetUnixTimestamp()
|
||||
{
|
||||
return ((DateTimeOffset)Now).ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前时间的Unix时间戳(毫秒)
|
||||
/// </summary>
|
||||
/// <returns>Unix时间戳(毫秒)</returns>
|
||||
public static long GetUnixTimestampMilliseconds()
|
||||
{
|
||||
return ((DateTimeOffset)Now).ToUnixTimeMilliseconds();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将Unix时间戳转换为中国标准时间
|
||||
/// </summary>
|
||||
/// <param name="timestamp">Unix时间戳(秒)</param>
|
||||
/// <returns>中国标准时间</returns>
|
||||
public static DateTime FromUnixTimestamp(long timestamp)
|
||||
{
|
||||
var utcTime = DateTimeOffset.FromUnixTimeSeconds(timestamp).DateTime;
|
||||
return ConvertUtcToChinaTime(utcTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将Unix时间戳(毫秒)转换为中国标准时间
|
||||
/// </summary>
|
||||
/// <param name="timestamp">Unix时间戳(毫秒)</param>
|
||||
/// <returns>中国标准时间</returns>
|
||||
public static DateTime FromUnixTimestampMilliseconds(long timestamp)
|
||||
{
|
||||
var utcTime = DateTimeOffset.FromUnixTimeMilliseconds(timestamp).DateTime;
|
||||
return ConvertUtcToChinaTime(utcTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ namespace OpenAuth.App
|
||||
/// <exception cref="Exception"></exception>
|
||||
private void SaveFile(string fileName, byte[] fileBuffers)
|
||||
{
|
||||
string folder = DateTime.Now.ToString("yyyyMMdd");
|
||||
string folder = TimeHelper.Now.ToString("yyyyMMdd");
|
||||
|
||||
//判断文件是否为空
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
|
||||
@@ -15,6 +15,7 @@ using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using SqlSugar;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Infrastructure.Helpers;
|
||||
|
||||
namespace OpenAuth.App.Flow
|
||||
{
|
||||
@@ -221,7 +222,7 @@ namespace OpenAuth.App.Flow
|
||||
}
|
||||
|
||||
var content =
|
||||
$"{user.Account}-{DateTime.Now:yyyy-MM-dd HH:mm}审批了【{Nodes[canCheckId].name}】" +
|
||||
$"{user.Account}-{TimeHelper.Now:yyyy-MM-dd HH:mm}审批了【{Nodes[canCheckId].name}】" +
|
||||
$"结果:{(tag.Taged == 1 ? "同意" : "不同意")},备注:{tag.Description}";
|
||||
SaveOperationHis(content);
|
||||
|
||||
@@ -389,7 +390,7 @@ namespace OpenAuth.App.Flow
|
||||
sugarClient.Updateable(flowInstance).ExecuteCommand();
|
||||
|
||||
SaveOperationHis(
|
||||
$"{user.Account}-{DateTime.Now.ToString("yyyy-MM-dd HH:mm")}驳回了【{currentNode.name}】");
|
||||
$"{user.Account}-{TimeHelper.Now.ToString("yyyy-MM-dd HH:mm")}驳回了【{currentNode.name}】");
|
||||
|
||||
NotifyThirdParty(client, currentNode, tag);
|
||||
}
|
||||
@@ -437,7 +438,7 @@ namespace OpenAuth.App.Flow
|
||||
item.Value.setInfo.UserId = tag.UserId;
|
||||
item.Value.setInfo.UserName = tag.UserName;
|
||||
item.Value.setInfo.Description = tag.Description;
|
||||
item.Value.setInfo.TagedTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
|
||||
item.Value.setInfo.TagedTime = TimeHelper.Now.ToString("yyyy-MM-dd HH:mm");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -462,7 +463,7 @@ namespace OpenAuth.App.Flow
|
||||
InstanceId = flowInstanceId,
|
||||
CreateUserId = userId,
|
||||
CreateUserName = userName,
|
||||
CreateDate = DateTime.Now,
|
||||
CreateDate = TimeHelper.Now,
|
||||
Content = opHis
|
||||
}; //操作记录
|
||||
|
||||
@@ -744,7 +745,7 @@ namespace OpenAuth.App.Flow
|
||||
ApproveType = node.setInfo.NodeConfluenceType,
|
||||
ReturnToSignNode = false,
|
||||
Reason = "",
|
||||
CreateDate = DateTime.Now
|
||||
CreateDate = TimeHelper.Now
|
||||
};
|
||||
sugarClient.Insertable(flowApprover).ExecuteCommand();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
|
||||
* @Date: 2024-12-13 16:55:17
|
||||
* @Description: 工作流实例表操作
|
||||
* @LastEditTime: 2025-04-21 10:54:45
|
||||
* @LastEditTime: 2025-10-18 14:35:01
|
||||
* Copyright (c) 2024 by yubaolee | ahfu~ , All Rights Reserved.
|
||||
*/
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace OpenAuth.App
|
||||
val = "";
|
||||
break;
|
||||
case "DateTime":
|
||||
val = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
val = TimeHelper.Now.ToString("yyyy-MM-dd");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -516,7 +516,7 @@ namespace OpenAuth.App
|
||||
}
|
||||
|
||||
var content =
|
||||
$"{user.Account}-{DateTime.Now.ToString("yyyy-MM-dd HH:mm")}审批了【{wfruntime.currentNode.name}】" +
|
||||
$"{user.Account}-{TimeHelper.Now.ToString("yyyy-MM-dd HH:mm")}审批了【{wfruntime.currentNode.name}】" +
|
||||
$"结果:{(tag.Taged == 1 ? "同意" : "不同意")},备注:{tag.Description}";
|
||||
wfruntime.SaveOperationHis(tag.UserId, tag.UserName, content);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using Infrastructure.Helpers;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
@@ -41,7 +42,7 @@ namespace OpenAuth.App
|
||||
{
|
||||
SchemeContent = flowScheme.SchemeContent,
|
||||
SchemeName = flowScheme.SchemeName,
|
||||
ModifyDate = DateTime.Now,
|
||||
ModifyDate = TimeHelper.Now,
|
||||
FrmId = flowScheme.FrmId,
|
||||
FrmType = flowScheme.FrmType,
|
||||
FrmUrlTemplate = flowScheme.FrmUrlTemplate,
|
||||
|
||||
@@ -11,6 +11,7 @@ using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using Infrastructure.Helpers;
|
||||
using Quartz;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -62,7 +63,7 @@ namespace OpenAuth.App
|
||||
public void Add(AddOrUpdateOpenJobReq req)
|
||||
{
|
||||
var obj = req.MapTo<OpenJob>();
|
||||
obj.CreateTime = DateTime.Now;
|
||||
obj.CreateTime = TimeHelper.Now;
|
||||
var user = _auth.GetCurrentUser().User;
|
||||
obj.CreateUserId = user.Id;
|
||||
obj.CreateUserName = user.Name;
|
||||
@@ -81,7 +82,7 @@ namespace OpenAuth.App
|
||||
Cron = obj.Cron,
|
||||
Status = obj.Status,
|
||||
Remark = obj.Remark,
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateTime = TimeHelper.Now,
|
||||
UpdateUserId = user.Id,
|
||||
UpdateUserName = user.Name
|
||||
},u => u.Id == obj.Id);
|
||||
@@ -126,7 +127,7 @@ namespace OpenAuth.App
|
||||
var user = _auth.GetCurrentUser().User;
|
||||
|
||||
job.Status = req.Status;
|
||||
job.UpdateTime = DateTime.Now;
|
||||
job.UpdateTime = TimeHelper.Now;
|
||||
job.UpdateUserId = user.Id;
|
||||
job.UpdateUserName = user.Name;
|
||||
Repository.Update(job);
|
||||
@@ -150,7 +151,7 @@ namespace OpenAuth.App
|
||||
}
|
||||
|
||||
job.RunCount++;
|
||||
job.LastRunTime = DateTime.Now;
|
||||
job.LastRunTime = TimeHelper.Now;
|
||||
Repository.Update(job);
|
||||
|
||||
_sysLogApp.Add(new SysLog
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Infrastructure;
|
||||
using Infrastructure.Helpers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
@@ -44,7 +45,7 @@ namespace OpenAuth.App
|
||||
RelKey = key,
|
||||
FirstId = sameVals.Key,
|
||||
SecondId = value,
|
||||
OperateTime = DateTime.Now
|
||||
OperateTime = TimeHelper.Now
|
||||
}).ToArray());
|
||||
UnitWork.Save();
|
||||
}
|
||||
@@ -152,7 +153,7 @@ namespace OpenAuth.App
|
||||
FirstId = request.RoleId,
|
||||
SecondId = request.ModuleCode,
|
||||
ThirdId = requestProperty,
|
||||
OperateTime = DateTime.Now
|
||||
OperateTime = TimeHelper.Now
|
||||
});
|
||||
}
|
||||
|
||||
@@ -206,7 +207,7 @@ namespace OpenAuth.App
|
||||
RelKey = Define.USERROLE,
|
||||
FirstId = firstId,
|
||||
SecondId = request.RoleId,
|
||||
OperateTime = DateTime.Now
|
||||
OperateTime = TimeHelper.Now
|
||||
}).ToArray());
|
||||
UnitWork.Save();
|
||||
});
|
||||
@@ -229,7 +230,7 @@ namespace OpenAuth.App
|
||||
RelKey = Define.USERORG,
|
||||
FirstId = firstId,
|
||||
SecondId = request.OrgId,
|
||||
OperateTime = DateTime.Now
|
||||
OperateTime = TimeHelper.Now
|
||||
}).ToArray());
|
||||
UnitWork.Save();
|
||||
});
|
||||
@@ -252,7 +253,7 @@ namespace OpenAuth.App
|
||||
RelKey = Define.ROLERESOURCE,
|
||||
FirstId = request.RoleId,
|
||||
SecondId = firstId,
|
||||
OperateTime = DateTime.Now
|
||||
OperateTime = TimeHelper.Now
|
||||
}).ToArray());
|
||||
UnitWork.Save();
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@ using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Helpers;
|
||||
|
||||
namespace OpenAuth.App
|
||||
{
|
||||
@@ -34,7 +35,7 @@ namespace OpenAuth.App
|
||||
{
|
||||
var obj = resource.MapTo<SysResource>();
|
||||
CaculateCascade(obj);
|
||||
obj.CreateTime = DateTime.Now;
|
||||
obj.CreateTime = TimeHelper.Now;
|
||||
var user = _auth.GetCurrentUser().User;
|
||||
obj.CreateUserId = user.Id;
|
||||
obj.CreateUserName = user.Name;
|
||||
@@ -56,7 +57,7 @@ namespace OpenAuth.App
|
||||
TypeId = obj.TypeId,
|
||||
TypeName = obj.TypeName,
|
||||
Description = obj.Description,
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateTime = TimeHelper.Now,
|
||||
UpdateUserId = user.Id,
|
||||
UpdateUserName = user.Name
|
||||
//todo:要修改的字段赋值
|
||||
@@ -157,7 +158,7 @@ namespace OpenAuth.App
|
||||
TypeId = Define.API,
|
||||
TypeName = "API接口",
|
||||
Description = api.Summary??"",
|
||||
CreateTime = DateTime.Now,
|
||||
CreateTime = TimeHelper.Now,
|
||||
CreateUserId = user.Id,
|
||||
CreateUserName = user.Name
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.Repository;
|
||||
|
||||
using Infrastructure.Helpers;
|
||||
using SqlSugar;
|
||||
|
||||
namespace OpenAuth.App
|
||||
@@ -72,7 +72,7 @@ namespace OpenAuth.App
|
||||
{
|
||||
SugarClient.Ado.BeginTran();
|
||||
Role role = obj;
|
||||
role.CreateTime = DateTime.Now;
|
||||
role.CreateTime = TimeHelper.Now;
|
||||
Repository.Insert(role);
|
||||
obj.Id = role.Id; //要把保存后的ID存入view
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using Infrastructure;
|
||||
using Infrastructure.Cache;
|
||||
using Infrastructure.Helpers;
|
||||
using OpenAuth.Repository;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using OpenAuth.Repository.Interface;
|
||||
@@ -76,12 +77,12 @@ namespace OpenAuth.App.SSO
|
||||
Name = sysUserInfo.Name,
|
||||
Token = Guid.NewGuid().ToString().GetHashCode().ToString("x"),
|
||||
AppKey = model.AppKey,
|
||||
CreateTime = DateTime.Now
|
||||
CreateTime = TimeHelper.Now
|
||||
// , IpAddress = HttpContext.Current.Request.UserHostAddress
|
||||
};
|
||||
|
||||
//创建Session
|
||||
_cacheContext.Set(currentSession.Token, currentSession, DateTime.Now.AddDays(10));
|
||||
_cacheContext.Set(currentSession.Token, currentSession, TimeHelper.Now.AddDays(10));
|
||||
|
||||
result.Code = 200;
|
||||
result.Token = currentSession.Token;
|
||||
|
||||
@@ -10,6 +10,7 @@ using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using OpenAuth.Repository.Interface;
|
||||
using Infrastructure.Helpers;
|
||||
|
||||
|
||||
namespace OpenAuth.App
|
||||
@@ -90,7 +91,7 @@ namespace OpenAuth.App
|
||||
FromId = Guid.Empty.ToString(),
|
||||
FromName = "系统管理员",
|
||||
Content = message,
|
||||
CreateTime = DateTime.Now
|
||||
CreateTime = TimeHelper.Now
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using OpenAuth.Repository.Core;
|
||||
using Infrastructure.Helpers;
|
||||
|
||||
namespace OpenAuth.Repository.Domain
|
||||
{
|
||||
@@ -36,10 +37,10 @@ namespace OpenAuth.Repository.Domain
|
||||
this.DeleteMark= 0;
|
||||
this.Disabled= 0;
|
||||
this.Description= string.Empty;
|
||||
this.CreateDate= DateTime.Now;
|
||||
this.CreateDate= TimeHelper.Now;
|
||||
this.CreateUserId= string.Empty;
|
||||
this.CreateUserName= string.Empty;
|
||||
this.ModifyDate= DateTime.Now;
|
||||
this.ModifyDate= TimeHelper.Now;
|
||||
this.ModifyUserId= string.Empty;
|
||||
this.ModifyUserName= string.Empty;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using OpenAuth.Repository.Core;
|
||||
using Infrastructure.Helpers;
|
||||
|
||||
namespace OpenAuth.Repository.Domain
|
||||
{
|
||||
@@ -27,19 +28,19 @@ namespace OpenAuth.Repository.Domain
|
||||
this.JobName= string.Empty;
|
||||
this.RunCount= 0;
|
||||
this.ErrorCount= 0;
|
||||
this.NextRunTime= DateTime.Now;
|
||||
this.LastRunTime= DateTime.Now;
|
||||
this.LastErrorTime= DateTime.Now;
|
||||
this.NextRunTime= TimeHelper.Now;
|
||||
this.LastRunTime= TimeHelper.Now;
|
||||
this.LastErrorTime= TimeHelper.Now;
|
||||
this.JobType= 0;
|
||||
this.JobCall= string.Empty;
|
||||
this.JobCallParams= string.Empty;
|
||||
this.Cron= string.Empty;
|
||||
this.Status= 0;
|
||||
this.Remark= string.Empty;
|
||||
this.CreateTime= DateTime.Now;
|
||||
this.CreateTime= TimeHelper.Now;
|
||||
this.CreateUserId= string.Empty;
|
||||
this.CreateUserName= string.Empty;
|
||||
this.UpdateTime= DateTime.Now;
|
||||
this.UpdateTime= TimeHelper.Now;
|
||||
this.UpdateUserId= string.Empty;
|
||||
this.UpdateUserName= string.Empty;
|
||||
this.OrgId= string.Empty;
|
||||
|
||||
@@ -3,7 +3,6 @@ title: 日志操作
|
||||
createTime: 2025/04/23 21:03:10
|
||||
permalink: /core/log/
|
||||
---
|
||||
|
||||
## 普通日志
|
||||
|
||||
框架默认使用Log4Net作为记录日志的方式,可以在Program.cs中配置日志参数或调整为其他日志。日志默认按日期生成日志文件,并存放在 `log\`目录下。简单用法如下:
|
||||
@@ -49,28 +48,7 @@ permalink: /core/log/
|
||||
}
|
||||
```
|
||||
|
||||
## EF打印Sql日志
|
||||
|
||||
在调试数据库时,需要打印真正执行的SQL信息。最简单的方式是使用下面方法输出到控制台:
|
||||
|
||||
```csharp
|
||||
public partial class OpenAuthDBContext : DbContext
|
||||
{
|
||||
|
||||
public static readonly ILoggerFactory MyLoggerFactory
|
||||
= LoggerFactory.Create(builder => { builder.AddConsole(); });
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.EnableSensitiveDataLogging (true); //允许打印参数
|
||||
optionsBuilder.UseLoggerFactory (MyLoggerFactory);
|
||||
|
||||
base.OnConfiguring (optionsBuilder);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## EF输出Sql到log4net
|
||||
## EF输出Sql到log4net(文件/控制台)
|
||||
|
||||
框架目前直接配置 `appsettings.Development.json`即可完成输出sql语句到log4net对应的日志文件中。如下:
|
||||
|
||||
@@ -119,6 +97,5 @@ public LoginResult Login(PassportLoginRequest request)
|
||||
return result;
|
||||
}
|
||||
```
|
||||
|
||||
这时调用该API后即可看到具体步骤一、步骤二、步骤三的执行时间情况了
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user