123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- /*用户使用www.1473.cn时,我们需要设置成: /#!/word/guid
- 用于推广运营时的链接如下:
- 电脑端
- word可编辑模式跳转 /word/guid。。
- word不可编辑模式 http://guid.1473.cn 或者短域名访问 http://123.1473.cn
- file的访问模式 /disk/guid
- 手机端
- word可编辑模式跳转: http://m.1473.cn/word/guid
- */
- Namespace.register("U.MD.N"); //Url执行区域
- /**
- * url指引函数
- * 此函数需要修改。。参数urlinfo的类型需要固定。
- */
- U.MD.N.urlGuide = function () {
- var _hash = U.UF.C.getUrlHash(), //获取传参
- _type; //类型
- //如果链接类型是 /#!/disk/13928417148/f6d7a4b6-e34c-4964-beed-24187b2cb1ba 的处理
- if (_hash[0] == "#!") {
- _hash.shift()
- }
- //链接类型是 /#disk/13928417148/f6d7a4b6-e34c-4964-beed-24187b2cb1ba 的处理
- else {
- _hash[0] = _hash[0].substr(1);
- }
- _type = _hash[0];
- switch (_type) {
- case "disk":
- //打开网盘的处理
- U.MD.D.I.openApplication(_type, { "userid": _hash[1], "directoryid": _hash[2] });
- break;
- case "file":
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- var _fileinfo = r.value[0];
- _fileinfo = new U.MD.DK.M.entity(_fileinfo.UserFilesID, _fileinfo.UserFilesSize, _fileinfo.UserDirectoryID, _fileinfo.UserFilesName, _fileinfo.UserFilesName, //创建US.disk.Disks里面的内容的数据结构
- _fileinfo.UserFilesExtendName, _fileinfo.UserFilesServerName, _fileinfo.UserFilesAddTime, null, 999, _fileinfo.UserFilesModifyTime, _fileinfo.UserDirectoryEncrypt,
- 1, _fileinfo.UserFilesExtendName, _fileinfo.GroupID, _fileinfo.UsOffice, _fileinfo.UserID, US.userInfo.UserNikeName, _fileinfo.UserName, _fileinfo.UserThumbnailImageHead);
- U.MD.DK.LE.openFileDirectory(_fileinfo);
- });
- break;
- case "excel":
- if (_hash[1] == 'join') { //如果地址栏有join进入加群流程
- U.MD.N.joinGuide(_hash, _type);
- }
- else if (_hash[1].length == 36) { //正常调用
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- if (r.value[0]) {
- //拼接word
- var _fileinfo = {
- UserDirectoryExtendType: r.value[0].UserFilesExtendName,
- UsOffice: r.value[0].UsOffice ? r.value[0].UsOffice.unEscapeQuotes() : null,
- UserId: r.value[0].UserID,
- UserallDirectoryName: r.value[0].UserFilesName,
- UserDirectoryID: r.value[0].UserFilesID,
- GroupID: r.value[0].UserDirectoryEncrypt
- };
- //获取word内容
- if (r.value && r.value.UsOffice !== undefined && r.value.UsOffice != null) {
- U.MD.D.I.openApplication(_type, _fileinfo);
- }
- }
- });
- }
- break
- case "word":
- if (_hash[1] == 'join') { //如果地址栏有join进入加群流程
- U.MD.N.joinGuide(_hash, _type);
- }
- else if (_hash[1].length == 36) { //正常调用
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- if (r.value[0]) {
- r = r.value[0];
- //拼接word
- var _fileinfo = {
- UserFilesServerName: r.UserFilesServerName,
- UserDirectoryExtendType: r.UserFilesExtendName,
- UsOffice: r.UsOffice ? r.UsOffice.unEscapeQuotes() : null,
- UserId: r.UserID,
- UserallDirectoryName: r.UserFilesName,
- UserDirectoryID: r.UserFilesID,
- GroupID: r.UserDirectoryEncrypt
- };
- //获取word内容
- if (r && r.UsOffice !== undefined && r.UsOffice != null) {
- U.MD.D.I.openApplication(_type, _fileinfo);
- }
- //如果内容不存在则去office系统中获取
- else {
- U.A.Request("http://office.1473.cn/Officetohtml.ashx", ["Open", _fileinfo.UserDirectoryExtendType, _fileinfo.UserFilesServerName], function (r) {
- if (r.value.value != undefined) {
- r = r.value;
- _fileinfo.UsOffice = r.value.getBodyHtml().replace(/src=[\'\"]?([^\'\"]*)[\'\"]?/ig, function (str1, str2) {
- return "src=\"http://office.1473.cn/usoffice/" + str2 + "\"";
- });
- U.MD.D.I.openApplication(_type, _fileinfo);
- } else {
- U.Alert('文档已丢失。。。');
- }
- });
- }
- }
- });
- }
- break;
- case "boomYun": case "txt": case "friend": case "lookupfriend": case "set": case "systemset":
- U.MD.D.I.openApplication(_type, { "directoryid": _hash[1] });
- if (_hash[1] == "template") {
- //打开模板函数
- if (_hash[2] != "undefined") {
- U.Boom.I.GetHomeTemp.particulars(_hash[2]);
- U.MD.N.urlWrite("boomYun/template/" + _hash[2], "互联办公"); //boomyun的url重写
- }
- }
- break;
- default: break;
- }
- }
- /**
- * 分享邀请链接加入群组
- * @param {hash} hash值
- * @param {type} 文件类型
- */
- U.MD.N.joinGuide = function (hash, type) {
- var _fileId = hash[2]; //获取文件id
- U.MD.U.L.setLoginCallBack(function () { //当用户登录后
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _fileId]), function (r) { //获取文档对的信息
- var _docinfo = r.value[0]; //文档信息
- if (!_docinfo) { //是否有文档信息
- return U.Alert('添加协同链接有误,请联系群主获取最新协同链接。。。');
- }
- if (US.friend.group) { //判断是否有群
- var _groupId = _docinfo.UserDirectoryEncrypt || _docinfo.UserDirectoryID, //获取群id
- _groupinfo = U.Json.select(US.friend.group, { "GroupManageID": _groupId })[0], //判断用户是否加入了群
- _docId = _docinfo.UserFilesID; //文档ID
- if (!_groupinfo) { //如果没有加群
- U.A.Request(US.CD, ([US.DB, "UseStudio_Friends", "GetGroupInfo", _groupId]), function (r) { //取数据库获取群的信息
- U.MD.F.J.selectUserInfo.NeedUser = [US.userInfo]; //得到个人信息名并赋值NeeUser全局
- US.friend.group.push(r.value[0]); //添加到用户的群
- top.U.MD.F.J.determineCreateGroupAndAddGroupUser(r.value[0].GroupManageID, null, null, false, "", "", function (groupid, groupdata) { //添加群
- U.Json.del(groupdata[0], { UserId: US.userInfo.userid });
- US.friend.groupusers.push.apply(US.friend.groupusers, groupdata[0]);
- // US.disk.Disks[US.userInfo.userid].directoryOrFiles.push.apply(US.disk.Disks[US.userInfo.userid].directoryOrFiles, _groupuserinfo);
- U.MD.D.I.openApplication(type, U.Json.select(groupdata[1], { UserDirectoryID: _docId })[0], function (contentwindow) { contentwindow.U.MD.O.W.Panel.addUser(US.userInfo.userid); }); //打开应用
- });
- }); //获取群资料
- } else { //加入了群
- var _docdiskinfo = new U.MD.DK.M.entity(_docinfo.UserFilesID, _docinfo.UserFilesSize, _docinfo.UserDirectoryID, _docinfo.UserFilesName, _docinfo.UserFilesName, //创建US.disk.Disks里面的内容的数据结构
- _docinfo.UserFilesExtendName, _docinfo.UserFilesServerName, _docinfo.UserFilesAddTime, null, 999, _docinfo.UserFilesModifyTime, _docinfo.UserDirectoryEncrypt,
- 0, _docinfo.UserFilesExtendName, _groupId, _docinfo.UsOffice, _docinfo.UserID, US.userInfo.UserNikeName, _docinfo.UserName, _docinfo.UserThumbnailImageHead);
- U.Alert("你已经在该文档的群里了!");
- U.MD.D.I.openApplication(type, _docdiskinfo); //打开应用
- }
- }
- })
- });
- }
- //添加页面导航
- /*
- * @param {string} hash值
- * @param {string} document.title变化
- */
- U.MD.N.urlWrite = function (hash, title) {
- setTimeout(function () {
- U.UF.N.addHash(hash); //添加hash的处理
- document.title = title; //title的处理
- }, 0);
- }
- //seo模块.现有访问网址。/
- //论坛
- // 目录: /#!/pb/afa8621d-de5a-44db-8338-7d36168e7446
- // 文章:外网:/#!/pbt/e80c57a0-1c82-4f43-931d-b7c8fab982a8
- //硬盘
- // 目录: /#!/disk/13928417148/f6d7a4b6-e34c-4964-beed-24187b2cb1ba
- // txt文件:/#!/txt/63e6b0c9-aa72-1ef5-a9c0-a9d19b2b4c39
- // word文件:/#!/word/efb4be75-696b-27fe-f125-25eff5d2716f
- // img文件:/#!/img/efb4be75-696b-27fe-f125-25eff5d2716f
- //现有word直接查看形式。
- //http://disk.1473.cn/efb4be75-696b-27fe-f125-25eff5d2716f/Word
- //http://disk.1473.cn/efb4be75-696b-27fe-f125-25eff5d2716f/Txt
- //http://disk.1473.cn/efb4be75-696b-27fe-f125-25eff5d2716f/Excel
- //从这些网址派生短链接。
- //10001.1473.cn
- //网盘文件直接打开查看
- ///#!/file/38807b15-e721-4820-88b2-5f88da69813b
|