From b8941a01d70f8b17ac3bd56b3878ba4f5488ab10 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Wed, 20 Nov 2024 18:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=96=87=E6=A1=A3=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/CNCEC_SUBQHSE_WUHUAN/v17/.wsuo | Bin 201216 -> 201216 bytes SGGL/BLL/Common/Funs.cs | 20 +++ .../AttachFile/OnlineEditingPrivate.aspx | 138 +++++++++--------- .../AttachFile/OnlineEditingPrivate.aspx.cs | 7 +- 4 files changed, 95 insertions(+), 70 deletions(-) diff --git a/.vs/CNCEC_SUBQHSE_WUHUAN/v17/.wsuo b/.vs/CNCEC_SUBQHSE_WUHUAN/v17/.wsuo index cfcb9e1f62701626f18a37352d78347d80e95f61..15c953afc2a2ba87e0f66028e44967fda9c6c81d 100644 GIT binary patch delta 1825 zcmdti+iw(A9Ki88({*>dot0g7X^ClrG;4{bi@WV!W{YS{i7|k%Dv|g?DBCs)C>ICs zN)by%E7CpXB6y=#yaA<-P(blU74Sj}{1Ya=_%IJZg7tfvZkY#2lX|!Ln0XCkv&sl z(kkl~eknXN+G+>~F%t&Y88G@ubFq>(`uCUR)P9NdGsxEJzLpguaE#sVzFLs$f9Ry?u%Ng6A$3ajxH zp2ixi#X79VGqA7$&*C{ej~DPFUc$?G1+QWwI&dw&fB&`e#`*R2KJI6<%1Vg0%7V(U z%9P4@=`ef~eX8G`arLdTt`2T0N*N!|bWckp{C`eyU%*?84I5E@cPV$OXl-Zu65-d0 zs_dwUm@PMi76nBWF;%;zxO75!qiiBD8MMMn{HmfS15S8EHkT!(Gj${=RL!fCxz-z5 zY&YL}QWPua8R{tSaCcgjqlSk-tt)6-Rf|PXsBPcw4m;BgQLKK@ug-sRb*nlrhxLSX z>PHQArS5cf+D?t(EjBa<$A`O9Ag#K*q1Gtf$nneU5LCqzbFCq*S>46D;hPv-e-k^r zMcvz|eR-Bo-?)k9YuJp}(TOeS!W-C%H}Mv_@iw;M9c)Jrije5V4(!A(?8dv;gS~hU z@8bh}h>z60+()AiAEO_iU_U;^XZRdn;7c69K^(#W4r35s!N%7(f}H{CDf zDLpBzIsd(kZ0o+f?>g7^0Vllc&qHEgEN2!HjhQwx-rkr>$5YvCTRhj8NW~KwGo4GP zleuix96C54mU=dOmJNB9iOz>(iS|NkOMCl@xM`*`@l>H95pT&QlgufYxom6eibNsX Q#T@48k3P2FDDx`+0x`7`S^xk5 delta 1472 zcmb7^TSyd97{}+#tm|rLYjxM!%BXaejat~t*lvX+bRoLAl7&JmjHVd$6chBO1>HcR z_6zK#7m?^85g91zv3#hfEV^IqUUt!Hy4XegADgWy3hcm-^UZ(0J?DSE^Ubz)^43m% zAjv07lEj!KO~Y)kqE42USF=*OD9_3|=C3&)p{?>I>h*<5SK1gS=9t;yM(S)Z0gQ}} zjuv9h0h2(nr9mDWemrO5Z&r|Nc`oyUXlD zYqF6m*7jJx5nhGI0_!=?nlpRZeT(x5fB8VfPO5Tv4{mV<$7`}jYi1o>?%j`l_yWFyZ(szB0tx0u4r*S$8^InRj)HHypQQs!-0aWll8z#dtFok*w4ty} zEN=Mbcgz27$gDW_%r%A=twdM(BBYnMrTt6C*Ndbt+D~%nnemyzbtkj`(lX14}hZ9nc( zIJKrKcGjJ!WBaNC4e`b@wZ2gcCFV!fkQ!6fP$I4+LXmhP9H}o$L}Hq{r>mQt?CO@+ dZD`+-qxk4@YF_*49HsbVu~Rvcb=0XizXRP+^|b&1 diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index d9cfa096..4df1e5b8 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -10,6 +10,7 @@ namespace BLL using System.Linq; using System.Net; using System.Reflection; + using System.Security.Cryptography; using System.Text; /// @@ -1281,6 +1282,25 @@ namespace BLL IRestResponse response = client.Execute(request); 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(); + } + + } } } diff --git a/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx b/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx index 988bce95..f2e33906 100644 --- a/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx +++ b/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx @@ -1,4 +1,5 @@ 锘<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OnlineEditingPrivate.aspx.cs" Inherits="FineUIPro.Web.AttachFile.OnlineEditingPrivate" %> +<%@ Import Namespace="BLL" %> @@ -102,7 +103,7 @@ xhr.open(method, url, true); if (method === "POST") xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xhr.setRequestHeader("token", "<%=this.CurrUser.UserId%>"); + xhr.setRequestHeader("token", "<%=this.CurrUser.UserId%>"); xhr.send(queryString); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { @@ -158,8 +159,9 @@ type = "mobile"; } }; - // var urlString = "https://cloud.e-iceblue.cn/demo/sample.docx"; - var urlString = "<%=BLL.Funs.SGGLUrl%>" + "<%=PCUrl%>"; + // var urlString = "https://cloud.e-iceblue.cn/demo/sample.docx"; + <%-- //var urlString = "<%=BLL.Funs.SGGLUrl%>" + "<%=PCUrl%>";--%> + var urlString = "<%=urlString%>"; var arrfn = urlString.split("."); var strp = arrfn[arrfn.length - 1]; @@ -197,77 +199,77 @@ } docEditor = new SpireCloudEditor.OpenApi("iframeEditor", { - fileAttrs: { - fileInfo: { - name: '', - ext: '', - primary: urlString, - creator: '', - createTime: new Date('20210505') - }, - sourceUrl: urlString, - createUrl: '', - callbackUrl: '', ////This item can be empty, but only if the 'onSave' callback function must be defined in events. If the callback function is undefined and this item is empty, Cloud Editor will not provide save function. - verification: null, //鐢ㄦ埛鏂囦欢绯荤粺涓嬭浇鏂囦欢鏃惰嫢闇瑕侀獙璇佺被浼紅oken鐨勬暟鎹彲浠ュ啓鍦ㄨ繖閲 - canEdit: true + fileAttrs: { + fileInfo: { + name: '', + ext: '', + primary: '<%=urlStringMD5%>', + creator: '', + createTime: new Date('20210505') }, - templates:"", - whiteLabel:true, - user: { - primary: '', - name: '<%=this.CurrUser.UserName%>', - canSave: true, - customization: { - public: { - common: { - whiteLabel: true, - defaultZoom: 1, - openReviewChanges: false, - permGroups: ['everyone'], //闄愬埗缂栬緫鍒嗙粍 - viewVersion: false, - header: { - hideTitle: false, - defaultView: 'full' - } - }, - word: null, //doc瀹氬埗 - powerpoint: null, //ppt瀹氬埗 - excel: null //xls瀹氬埗 + sourceUrl: urlString, + createUrl: '', + callbackUrl: '', ////This item can be empty, but only if the 'onSave' callback function must be defined in events. If the callback function is undefined and this item is empty, Cloud Editor will not provide save function. + verification: null, //鐢ㄦ埛鏂囦欢绯荤粺涓嬭浇鏂囦欢鏃惰嫢闇瑕侀獙璇佺被浼紅oken鐨勬暟鎹彲浠ュ啓鍦ㄨ繖閲 + canEdit: true + }, + templates: "", + whiteLabel: true, + user: { + primary: '', + name: '<%=this.CurrUser.UserName%>', + canSave: true, + customization: { + public: { + common: { + whiteLabel: true, + defaultZoom: 1, + openReviewChanges: false, + permGroups: ['everyone'], //闄愬埗缂栬緫鍒嗙粍 + viewVersion: false, + header: { + hideTitle: false, + defaultView: 'full' + } }, - "private": { - "token": null, - "appid": null, - "appkey": null - } - } - }, - editorAttrs: { //缂栬緫鍣ㄩ厤缃 - editorWidth: '100%', - editorHeight: '100%', - editorMode: '<%=editorMode%>', - editorType: 'document', //缂栬緫鍣ㄧ被鍨嬶紝鍙笉閰嶇疆锛岀▼搴忔牴鎹枃浠剁被鍨嬭幏鍙栵紝缁撴灉涓 document,presentation,spreadsheet - platform: 'windows', //缂栬緫鍣ㄥ钩鍙扮被鍨嬶紝鍙墂indows锛 mobile锛 embedded - viewLanguage: 'zh', //骞冲彴鐣岄潰灞曠ず璇█鍙塭n/zh - canChat: true, //鏄惁鍙亰澶 - canComment: true, //鏄惁鍙壒娉 - canReview: true, - canDownload: true, - canForcesave: true, - embedded: { - saveUrl: '', - embedUrl: '', - shareUrl: '' + word: null, //doc瀹氬埗 + powerpoint: null, //ppt瀹氬埗 + excel: null //xls瀹氬埗 }, - events: { - 'onReady': onReady, - 'onDocumentStateChange': onDocumentStateChange, - 'onError': onError, - 'onRequestEditRights': onRequestEditRights, - 'onOutdatedVersion': onOutdatedVersion, - 'onSave': callbackfn + "private": { + "token": null, + "appid": null, + "appkey": null } } }, + editorAttrs: { //缂栬緫鍣ㄩ厤缃 + editorWidth: '100%', + editorHeight: '100%', + editorMode: '<%=editorMode%>', + editorType: 'document', //缂栬緫鍣ㄧ被鍨嬶紝鍙笉閰嶇疆锛岀▼搴忔牴鎹枃浠剁被鍨嬭幏鍙栵紝缁撴灉涓 document,presentation,spreadsheet + platform: 'windows', //缂栬緫鍣ㄥ钩鍙扮被鍨嬶紝鍙墂indows锛 mobile锛 embedded + viewLanguage: 'zh', //骞冲彴鐣岄潰灞曠ず璇█鍙塭n/zh + canChat: true, //鏄惁鍙亰澶 + canComment: true, //鏄惁鍙壒娉 + canReview: true, + canDownload: true, + canForcesave: true, + embedded: { + saveUrl: '', + embedUrl: '', + shareUrl: '' + }, + events: { + 'onReady': onReady, + 'onDocumentStateChange': onDocumentStateChange, + 'onError': onError, + 'onRequestEditRights': onRequestEditRights, + 'onOutdatedVersion': onOutdatedVersion, + 'onSave': callbackfn + } + } + }, appid, appkey ); diff --git a/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx.cs b/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx.cs index b37339d9..78b061e3 100644 --- a/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx.cs +++ b/SGGL/FineUIPro.Web/AttachFile/OnlineEditingPrivate.aspx.cs @@ -11,7 +11,7 @@ namespace FineUIPro.Web.AttachFile public partial class OnlineEditingPrivate : PageBase { #region 瀹氫箟鍙傛暟 - + public string CallBackUrl { get @@ -60,6 +60,8 @@ namespace FineUIPro.Web.AttachFile ViewState["editorMode"] = value; } } + public string urlString = String.Empty; + public string urlStringMD5 = String.Empty; #endregion protected void Page_Load(object sender, EventArgs e) @@ -72,7 +74,8 @@ namespace FineUIPro.Web.AttachFile PCUrl = Request.Params["fileUrl"]; editorMode = Request.Params["editorMode"]; - + urlString = Funs.SGGLUrl + PCUrl; + urlStringMD5 = Funs.GetMD5(urlString); } } }