在线文档编辑修改

This commit is contained in:
李鹏飞 2024-11-20 18:48:45 +08:00
parent 8a39c901d4
commit b8941a01d7
4 changed files with 95 additions and 70 deletions

Binary file not shown.

View File

@ -10,6 +10,7 @@ namespace BLL
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Reflection; using System.Reflection;
using System.Security.Cryptography;
using System.Text; using System.Text;
/// <summary> /// <summary>
@ -1281,6 +1282,25 @@ namespace BLL
IRestResponse response = client.Execute(request); IRestResponse response = client.Execute(request);
return response.Content; return response.Content;
} }
public static string GetMD5(string str)
{
using (MD5 md5 = MD5.Create())
{
// 将输入字符串转换为字节数组并计算哈希值
byte[] inputBytes = Encoding.ASCII.GetBytes(str);
byte[] hashBytes = md5.ComputeHash(inputBytes);
// 将字节数组转换为十六进制字符串
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
{
sb.Append(hashBytes[i].ToString("X2"));
}
return sb.ToString();
}
}
} }
} }

View File

@ -1,4 +1,5 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OnlineEditingPrivate.aspx.cs" Inherits="FineUIPro.Web.AttachFile.OnlineEditingPrivate" %> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OnlineEditingPrivate.aspx.cs" Inherits="FineUIPro.Web.AttachFile.OnlineEditingPrivate" %>
<%@ Import Namespace="BLL" %>
<!DOCTYPE html> <!DOCTYPE html>
@ -159,7 +160,8 @@
} }
}; };
// var urlString = "https://cloud.e-iceblue.cn/demo/sample.docx"; // var urlString = "https://cloud.e-iceblue.cn/demo/sample.docx";
var urlString = "<%=BLL.Funs.SGGLUrl%>" + "<%=PCUrl%>"; <%-- //var urlString = "<%=BLL.Funs.SGGLUrl%>" + "<%=PCUrl%>";--%>
var urlString = "<%=urlString%>";
var arrfn = urlString.split("."); var arrfn = urlString.split(".");
var strp = arrfn[arrfn.length - 1]; var strp = arrfn[arrfn.length - 1];
@ -201,7 +203,7 @@
fileInfo: { fileInfo: {
name: '', name: '',
ext: '', ext: '',
primary: urlString, primary: '<%=urlStringMD5%>',
creator: '', creator: '',
createTime: new Date('20210505') createTime: new Date('20210505')
}, },

View File

@ -60,6 +60,8 @@ namespace FineUIPro.Web.AttachFile
ViewState["editorMode"] = value; ViewState["editorMode"] = value;
} }
} }
public string urlString = String.Empty;
public string urlStringMD5 = String.Empty;
#endregion #endregion
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
@ -72,7 +74,8 @@ namespace FineUIPro.Web.AttachFile
PCUrl = Request.Params["fileUrl"]; PCUrl = Request.Params["fileUrl"];
editorMode = Request.Params["editorMode"]; editorMode = Request.Params["editorMode"];
urlString = Funs.SGGLUrl + PCUrl;
urlStringMD5 = Funs.GetMD5(urlString);
} }
} }
} }