在线文档编辑修改
This commit is contained in:
parent
8a39c901d4
commit
b8941a01d7
Binary file not shown.
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@
|
||||||
xhr.open(method, url, true);
|
xhr.open(method, url, true);
|
||||||
if (method === "POST")
|
if (method === "POST")
|
||||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
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.send(queryString);
|
||||||
xhr.onreadystatechange = function () {
|
xhr.onreadystatechange = function () {
|
||||||
if (xhr.readyState === 4) {
|
if (xhr.readyState === 4) {
|
||||||
|
@ -158,8 +159,9 @@
|
||||||
type = "mobile";
|
type = "mobile";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 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];
|
||||||
|
@ -197,77 +199,77 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
docEditor = new SpireCloudEditor.OpenApi("iframeEditor", {
|
docEditor = new SpireCloudEditor.OpenApi("iframeEditor", {
|
||||||
fileAttrs: {
|
fileAttrs: {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
name: '',
|
name: '',
|
||||||
ext: '',
|
ext: '',
|
||||||
primary: urlString,
|
primary: '<%=urlStringMD5%>',
|
||||||
creator: '',
|
creator: '',
|
||||||
createTime: new Date('20210505')
|
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, //用户文件系统下载文件时若需要验证类似token的数据可以写在这里
|
|
||||||
canEdit: true
|
|
||||||
},
|
},
|
||||||
templates:"",
|
sourceUrl: urlString,
|
||||||
whiteLabel:true,
|
createUrl: '',
|
||||||
user: {
|
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.
|
||||||
primary: '',
|
verification: null, //用户文件系统下载文件时若需要验证类似token的数据可以写在这里
|
||||||
name: '<%=this.CurrUser.UserName%>',
|
canEdit: true
|
||||||
canSave: true,
|
},
|
||||||
customization: {
|
templates: "",
|
||||||
public: {
|
whiteLabel: true,
|
||||||
common: {
|
user: {
|
||||||
whiteLabel: true,
|
primary: '',
|
||||||
defaultZoom: 1,
|
name: '<%=this.CurrUser.UserName%>',
|
||||||
openReviewChanges: false,
|
canSave: true,
|
||||||
permGroups: ['everyone'], //限制编辑分组
|
customization: {
|
||||||
viewVersion: false,
|
public: {
|
||||||
header: {
|
common: {
|
||||||
hideTitle: false,
|
whiteLabel: true,
|
||||||
defaultView: 'full'
|
defaultZoom: 1,
|
||||||
}
|
openReviewChanges: false,
|
||||||
},
|
permGroups: ['everyone'], //限制编辑分组
|
||||||
word: null, //doc定制
|
viewVersion: false,
|
||||||
powerpoint: null, //ppt定制
|
header: {
|
||||||
excel: null //xls定制
|
hideTitle: false,
|
||||||
|
defaultView: 'full'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"private": {
|
word: null, //doc定制
|
||||||
"token": null,
|
powerpoint: null, //ppt定制
|
||||||
"appid": null,
|
excel: null //xls定制
|
||||||
"appkey": null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
editorAttrs: { //编辑器配置
|
|
||||||
editorWidth: '100%',
|
|
||||||
editorHeight: '100%',
|
|
||||||
editorMode: '<%=editorMode%>',
|
|
||||||
editorType: 'document', //编辑器类型,可不配置,程序根据文件类型获取,结果为 document,presentation,spreadsheet
|
|
||||||
platform: 'windows', //编辑器平台类型,可选windows, mobile, embedded
|
|
||||||
viewLanguage: 'zh', //平台界面展示语言可选en/zh
|
|
||||||
canChat: true, //是否可聊天
|
|
||||||
canComment: true, //是否可批注
|
|
||||||
canReview: true,
|
|
||||||
canDownload: true,
|
|
||||||
canForcesave: true,
|
|
||||||
embedded: {
|
|
||||||
saveUrl: '',
|
|
||||||
embedUrl: '',
|
|
||||||
shareUrl: ''
|
|
||||||
},
|
},
|
||||||
events: {
|
"private": {
|
||||||
'onReady': onReady,
|
"token": null,
|
||||||
'onDocumentStateChange': onDocumentStateChange,
|
"appid": null,
|
||||||
'onError': onError,
|
"appkey": null
|
||||||
'onRequestEditRights': onRequestEditRights,
|
|
||||||
'onOutdatedVersion': onOutdatedVersion,
|
|
||||||
'onSave': callbackfn
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
editorAttrs: { //编辑器配置
|
||||||
|
editorWidth: '100%',
|
||||||
|
editorHeight: '100%',
|
||||||
|
editorMode: '<%=editorMode%>',
|
||||||
|
editorType: 'document', //编辑器类型,可不配置,程序根据文件类型获取,结果为 document,presentation,spreadsheet
|
||||||
|
platform: 'windows', //编辑器平台类型,可选windows, mobile, embedded
|
||||||
|
viewLanguage: 'zh', //平台界面展示语言可选en/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,
|
appid,
|
||||||
appkey
|
appkey
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace FineUIPro.Web.AttachFile
|
||||||
public partial class OnlineEditingPrivate : PageBase
|
public partial class OnlineEditingPrivate : PageBase
|
||||||
{
|
{
|
||||||
#region 定义参数
|
#region 定义参数
|
||||||
|
|
||||||
public string CallBackUrl
|
public string CallBackUrl
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue