【修复】修复Luban.Server在linux平台(\n)和win平台(\r\n)生成的文本换行符不一样的问题(导致不同平台生成结果不一样)。统一为 \n

main
walon 2021-06-30 10:19:15 +08:00
parent 02a7973f42
commit 5c038ca449
1 changed files with 1 additions and 0 deletions

View File

@ -27,6 +27,7 @@ namespace Luban.Job.Common.Utils
public static string GenMd5AndAddCache(string fileName, string content)
{
content = content.Replace("\r\n", "\n");
var bytes = System.Text.Encoding.UTF8.GetBytes(content);
var md5 = FileUtil.CalcMD5(bytes);
CacheManager.Ins.AddCache(fileName, md5, bytes);