Onload.js 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099
  1. //------------------------------------------------------------------------------------用戶桌面和程序數據初始化區域----------------------------------------------------------------------------------------------------------------
  2. Namespace.register("U.MD.D"); //桌面onload和桌面總控的命名空間
  3. /*
  4. window.onload的流程:
  5. 1、自由屬性的設置,例如:頁面識別id。允許瀏覽器多頁面瀏覽www.1473.cn
  6. 2、加載各種事件綁定,如:頁面大小監視,不允許選擇桌面文字,ie7以下瀏覽器頁面提示
  7. 3、加載桌面圖標。
  8. 4、加載跨域設置,如果沒有跨域,首頁數據無法獲取
  9. 4、加載首頁
  10. 5、加載廣告,QQ登錄等外鏈。
  11. UD和UC區別 uc是框架函數 ud為操作系統原殼 這裏的簡化的目標很簡單 只要有人應用ud 就會引用一個web操作系統 提供操作系統的功能應用
  12. 難題 :
  13. 1、命名和用戶沖突 會導致原web系統不可使用
  14. 2、函數沖突 如 用戶自帶window.resize這樣的函數 我們提供了接口 但是這個接口的的暴露性可見性體現出文檔的重要 宣傳文檔也就是文宣的重要性高了
  15. 3、有參數註釋的都為暴露接口類型 其他都為內部使用 更好的體現方式
  16. */
  17. //#region 配置區域,相當於全局變量定義
  18. U.MD.D.IsUseStudio = true;
  19. //本地存儲類
  20. U.MD.D.LocalStorage = null;
  21. //#endregion
  22. //#region onload處理
  23. /**
  24. * 系統初始化處理
  25. *
  26. * @param {function} 在外部項目應用該項目的時候 可以傳入cb這個參數,如果傳入了這個參數在回調跨域main.1473.cn加載成功會就會直接回調
  27. */
  28. window.onload = function () {
  29. U.MD.D.Load();
  30. U.MD.U.L.login();
  31. //U.MD.D.isLogin();
  32. // U.MD.D.fullscreen();
  33. U.MD.D.stopSafari();
  34. // window.addEventListener('resize', () => {
  35. // var realHeight = window.innerHeight
  36. // var realWidth = window.innerWidth
  37. // initViewport(realHeight, realWidth);
  38. // // window.location.reload();
  39. // })
  40. }
  41. US.Config = {
  42. server: '//cloud.api.cocorobo.hk/api/',
  43. api: '//beta.api.cocorobo.cn/',
  44. chat: "//chat.api.cocorobo.cn/",
  45. edu: '//api.edu.cocorobo.cn/edu/',
  46. origin: '//cocorobo.cn',
  47. pbl: "//pbl.cocorobo.cn/api/pbl/",
  48. // bpbl:"//pbl.cocorobo.cn",//正式鏈接
  49. // bpbl:"//beta.pbl.cocorobo.cn",//測試鏈接
  50. bpbl:"//pbl.cocorobo.hk",//hk鏈接
  51. // pbl: "http://localhost:7003/api/pbl/",
  52. basename: '',
  53. type:1,
  54. background:'url("/img/icon/bgImg4.png")'
  55. }
  56. /**
  57. * 供外部調用的window.onload函數雲端系統啟動項
  58. *
  59. * @param {function} 在外部項目應用該項目的時候 可以傳入cb這個參數,如果傳入了這個參數在回調跨域main.1473.cn加載成功會就會直接回調
  60. */
  61. U.MD.D.Load = U.MD.D.FLoad = function (cb) {
  62. //這裏判斷是如果是www.1473.cn 或者 www.boomyun.com項目的時候 或者是 通過ufrom的跨域函數加載成功頁面時候可以執行window.onload, 添加判斷的目的主要是反正 其他項目引用uformd的時候自動執行window.onload報錯。
  63. //當引用雲端硬盤,好友模塊時需要在自己的js文件中添加window.onload入口函數,否則會觸發雲端的window.onload,導致系統報錯,
  64. //初始化桌面,如果是1473主站點那麼初始化桌面系統,否則外部引入1473不加載桌面
  65. //系統初始化、第一個就是加載桌面,然後初始化全局變量、綁定事件、最後加載數據(加載數據需要跨域加載,因為項目分離的原因,我們有disk.1473.cn、user.1473.cn、firend.1473.cn裏面有靜態數據,還有動態的後臺)
  66. if (U.MD.D.IsUseStudio) {
  67. //桌面初始化彈出
  68. U.selectEl("#UD_Dtop")[0].style.display = "block";
  69. //桌面做為一個置底的窗體
  70. new U.UF.UI.form(false, U.selectEl("#UD_Dtop")[0], { onresize: true, style: { "cssText": "width:100%;height:100%;padding:0;border:0;border-radius:0;box-shadow:0;position:static;" }, "className": "" }, { istop: false, isdrag: false, isdrag: false, isstretching: false, isenlarge: false, isnarrow: false, isclose: false }, null, { style: { "padding": "0" } });
  71. }
  72. //這裏加判斷的原因是怕有開發者開發的過程中直接調用uformd.js沒有寫跨域加載,沒有寫window.onload導致再運行的過程中找不到元素報錯
  73. if ($("#U_MD_Home")[0]) {
  74. //設置頁面大小等的全局變量
  75. U.MD.D.settingGlobalVariables();
  76. //瀏覽器事件監視及處理
  77. U.MD.D.addEvents();
  78. //var _browserinfo = U.UF.CI.getBrowser(); //獲取瀏覽器
  79. ////ie7以下的瀏覽器彈出不兼容的處理
  80. //if (_browserinfo["browser"] == "msie" && parseInt(_browserinfo["ver"]) < 7) {
  81. // //彈出不兼容的處理
  82. // U.MD.D.A.browserCompatibleForm();
  83. //}
  84. }
  85. //跨域加載
  86. U.MD.D.crossDomain(cb); //跨域初始化,裏面包含了用戶登錄
  87. }
  88. /**
  89. * 設置當前使用頁面大小
  90. */
  91. U.MD.D.settingGlobalVariables = function () {
  92. //獲取頁面的大小
  93. var _size = U.selectEl("body").getElementInfo();
  94. US.height = _size["CH"]; //獲取高度
  95. US.width = _size["CW"]; //獲取寬度
  96. //1473的登錄識別id
  97. US.systemId = 1;
  98. //頁面識別id 頁面唯一的識別 作為用戶訪問1473的唯一識別碼,在之前用戶獲取聊天室的信息的唯一識別碼
  99. US.pageId = Guid.newGuid();
  100. }
  101. /**
  102. * 系統監視
  103. */
  104. U.MD.D.addEvents = function () {
  105. //頁面活動狀態監視,失焦的時候停止五秒刷新,聚焦的時候開始刷新
  106. U.UF.EV.IsActivity(U.MD.D.focus, U.MD.D.blur);
  107. //監視頁面的點擊 使得窗體點擊為頂部
  108. U.UF.F.clickTopWindow();
  109. //頁面大小變化監視
  110. U.MD.D.reSize();
  111. window.onresize = U.MD.D.reSize;
  112. //如果是雲端1473則屏蔽菜單和錯誤彈框
  113. if (U.MD.D.IsUseStudio) {
  114. if (window.print) { //判斷是否有右鍵菜單
  115. document.oncontextmenu = U.UF.EV.stopDefault; //阻止桌面右鍵默認菜單
  116. }
  117. document.onselectstart = U.UF.C.shieldedSelect; //禁止文本選擇處理
  118. U.UF.EV.addElementEvent("keydown", document, U.UF.C.shieldedBackspace); //禁止瀏覽器回退
  119. //window.onerror = U.MD.D.error; //錯誤提示屏蔽
  120. }
  121. //允許錯誤提示和右鍵菜單
  122. else {
  123. window.onerror = null;
  124. }
  125. //頁面路由事件處理
  126. U.UF.N.route(U.MD.N.urlGuide);
  127. }
  128. /**
  129. * 頁面大小變化時,需要重新排列圖標及任務欄大小的變化.
  130. */
  131. U.MD.D.reSize = function () {
  132. //頁面變化處理
  133. //獲取頁面的大小
  134. // US.height = window.innerHeight > window.innerWidth ? window.innerWidth : window.innerHeight;
  135. // US.width = window.innerHeight > window.innerWidth ? window.innerHeight : window.innerWidth;
  136. var _size = U.selectEl("html").getElementInfo();
  137. if (_size["CH"] > 500) {
  138. //處理窗體區域 隨著頁面大小變化而變化
  139. U.UF.UI.form.windowResize();
  140. // var _size = U.selectEl("body").getElementInfo();
  141. US.height = _size["CH"]; //獲取高度
  142. US.width = _size["CW"]; //獲取寬度;
  143. document.body.style.width = US.width + 'px';
  144. document.body.style.height = US.height + 'px';
  145. //任務欄處理
  146. if ($("#U_MD_D_RW")) {
  147. U.selectEl("#U_MD_D_RW").css("width", US.width - 165 + "px");
  148. U.MD.D.T.taskbar.multitask($("#U_MD_D_RW")[0]);
  149. //桌面圖標處理
  150. if(US.Config.type == '1'){
  151. U.MD.D.iconPostion($("#U_MD_D_K").Child());
  152. }else{
  153. U.MD.D.iconPostion2($("#U_MD_D_K").Child());
  154. }
  155. }
  156. }
  157. }
  158. /**
  159. * 跨域引入1473
  160. * @param {function} 跨域加載成功後的回調函數
  161. */
  162. U.MD.D.crossDomain = function (cb) {
  163. U.MD.D.loadApplication(cb);
  164. ////跨域加載,如果是1473的跨域,那麼則添加跨域的iframe處理
  165. //if (document.domain == "1473.cn") {
  166. // U.UF.CD.loadAjaxCrossDomain(function () {
  167. // U.MD.D.loadApplication(cb);
  168. // });
  169. //}
  170. ////如果是非1473的跨域,添加跨域的iframe
  171. //else {
  172. // U.UF.CD.thirdPartyLoadAjaxCrossDomain(function () {
  173. // U.MD.D.loadApplication(cb);
  174. // });
  175. //}
  176. }
  177. /**
  178. * 加載user 、 friend 、disk的js
  179. */
  180. U.MD.D.loadApplication = function (cb) {
  181. //U.UF.CD.loadApplication(function () {
  182. // U.MD.D.asynCrossDomain(cb);
  183. //});
  184. U.MD.D.asynCrossDomain(cb);
  185. }
  186. /**
  187. * 域名加載成功後異步 此處可正式獲取數據
  188. * @param {function} 跨域加載成功後的回調函數
  189. */
  190. U.MD.D.asynCrossDomain = function (cb) {
  191. ////初始化url的處理
  192. //U.MD.N.urlGuide();
  193. ////通過cookie登錄
  194. //U.MD.U.L.cookieLogin();
  195. ////如果是1473則彈出1473的首頁
  196. //if (U.MD.D.IsUseStudio) {
  197. // U.MD.D.I.openApplication("boomYun");
  198. //}
  199. ////其它模塊加載處理
  200. //U.MD.D.otherModularLoad();
  201. ////添加用戶訪問記錄
  202. //U.UF.CI.getUserLocation(U.MD.D.visitLog);
  203. //桌面開始點,起始函數
  204. if ($("#UD_Dtop")[0]) {
  205. U.MD.D.I.init();
  206. }
  207. //如果其他站點進入1473,這裏是引入成功的回調處理
  208. if (U.UF.C.isFunction(cb)) {
  209. cb(); //回調處理
  210. }
  211. setInterval(function () {
  212. U.MD.D.getuser(); //用戶登錄
  213. }, 2000)
  214. setInterval(function () {
  215. U.MD.D.addLoginTime(); //用戶登錄
  216. }, 600000)
  217. }
  218. /**
  219. * 其它模塊的加載
  220. */
  221. U.MD.D.otherModularLoad = function () {
  222. //計時器消息初始化 每個3秒刷一次消息
  223. U.MD.C.T.onesetInterval();
  224. //加載如廣告 各模塊加載
  225. U.MD.D.thirdPartyLoad(); //頁面插件加載
  226. //html5本地存儲,暫時用來完成本地頁面交互消息 作用共享頁面信息,還未完善。
  227. //U.MD.D.record();
  228. }
  229. /**
  230. * 第三方廣告和登錄加載處理
  231. */
  232. U.MD.D.thirdPartyLoad = function () {
  233. //阿裏巴巴廣告加載
  234. // U.UF.DL.C.AD.alimama([
  235. // { pid: "mm_32325420_3265865_24254681", appkey: "", unid: "" },
  236. // { pid: "mm_32325420_3265865_14752067", appkey: "", unid: "" },
  237. // { pid: "mm_32325420_3265865_24246760", appkey: "", unid: "" },
  238. // { pid: "mm_32325420_3265865_24254681", appkey: "", unid: ""}]);
  239. //qq登錄加載按鈕
  240. // U.MD.U.OT.qqLoadJs({ btnId: "U_MD_U_L_login_O_T_app_QQ", size: "C_S" });
  241. //微博登錄加載按鈕
  242. // U.MD.U.OT.weiboLoadJs({ id: "U_MD_U_L_login_O_T_app_I", type: "3,2", show_head: false, show_name: false, show_cancel: false,
  243. // callback: { login: U.MD.U.OT.weiboLoginCallBack }
  244. // });
  245. //百度統計加載
  246. // U.UF.DL.C.AD.onloadBaiduJs("1fce47ee7e8655ddd108fca7116f0752");
  247. // U.UF.DL.C.AD.onloadBaiduJs("f0ececeb4f687bc4d4ffb7719f4cf6a7");
  248. }
  249. /**
  250. * 寫入訪問用戶信息
  251. */
  252. U.MD.D.visitLog = function () {
  253. U.A.Request(US.USER, ["AddToLoginLog", US.userInfo.UserId || US.EMPTYGUID, US.city.userAllLocation || ""], function () { }); //訪問日誌添加消息
  254. }
  255. //#endregion
  256. //#region 頁面事件處理
  257. //關閉頁面處理 把頁面的活動數-1
  258. window.onunload = function () {
  259. try {
  260. var _userinfo = US.userInfo;
  261. if (U.MD.D.LocalStorage) {
  262. var _count = U.MD.D.LocalStorage.get("ati") || 0;
  263. if (_count > 0) { _count-- };
  264. U.MD.D.LocalStorage.set("ati", _count); //這是活動用戶-1
  265. }
  266. if (_userinfo.UserId && U.A) { //在狀態中讓這個活動用戶下線
  267. U.A.Request(US.USER, ["UserOffline", _userinfo.UserId], function () { }, []);
  268. }
  269. } catch (e) { }
  270. }
  271. //錯誤處理,前端錯誤需要在控製臺輸出,同時提交到錯誤數據庫
  272. //window.onerror = function(sMessage,sUrl,sLine,columnNumber,errorObj){};
  273. //onerror函數的五個參數用於確定錯誤確切的信息,代表的意思依次為:
  274. //* @param {String} errorMessage errorMessage 錯誤信息
  275. //* @param {String} scriptURI 出錯的文件
  276. //* @param {Long} lineNumber 出錯代碼的行號
  277. //* @param {Long} columnNumber 出錯代碼的列號
  278. //* @param {Object} errorObj 錯誤的詳細信息,Anything
  279. U.MD.D.error = function (errorMessage, scripturi, linenumber, columnnumber, errorobj) {
  280. errorobj = errorobj || {}; //屏蔽js錯誤
  281. U.A.Request(US.USER, ["SetError", 0, (event.errorMessage || event || errorMessage), (scripturi || event.filename || event.errorUr) + "。行號:" + (linenumber || event.lineno || event.errorLine)], function () { }, []); //錯誤消息發送到數據庫
  282. U.UF.C.console(event.errorMessage || event || errorobj); //console 輸出錯誤信息
  283. return true; //不讓瀏覽器彈出錯誤報告,瀏覽器會彈出一個comfirm的錯誤。
  284. }
  285. /**
  286. * 用戶登錄處理
  287. */
  288. let LoginState = false
  289. U.MD.D.getuser = function () {
  290. // $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gif/longhuaBg.gif")'
  291. var userInfo = US.userInfo;
  292. if (Object.keys(userInfo).length === 0 && !U.UF.C.queryString('code')) {
  293. var _cookie = U.UF.Cookie.get("cocorobo");
  294. if (Object.keys(userInfo).length === 0 && (_cookie||document.domain!="cocorobo.cn")) {
  295. U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
  296. if (res.value && res.value[0] && res.value[0][0]) {
  297. var _user = res.value[0][0];
  298. U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
  299. if (res.value && res.value[0] && res.value[0][0]) {
  300. US.userInfo = res.value[0][0]; //記錄用戶數據
  301. US.userInfo.userid = _user.userid;
  302. if ($("#U_MD_HomeC_Pop")[0]) {
  303. $("#U_MD_HomeC_Pop")[0].close(); //關閉登陸
  304. }
  305. U.A.Request(US.Config.pbl + "selectUser?userid=" + _user.userid, [], function (res) { //US.userInfo.userid
  306. if (res.value == null || res.value[0].length == 0) {
  307. // U.MD.D.I.openApplication("my")
  308. let _name = US.userInfo.alias ? US.userInfo.alias : US.userInfo.username
  309. let _type = US.userInfo == 1 ? 2 : 1
  310. // US.Config.pbl
  311. // "http://localhost:7003/api/pbl/"
  312. U.A.Request(US.Config.pbl + "updatePblMessage", [_user.userid, _name, _type, '16d397f3-b192-11ed-9211-005056b86db5', '', '', "0"], function (res) {
  313. window.location.reload();
  314. }, [], { "type": "POST", "withCredentials": true });
  315. } else {
  316. if(res.value[0][0].isLogin1 == 2 || res.value[0][0].isLogin2 == 2){
  317. U.MD.U.LO.logoutSystem2();
  318. return;
  319. }
  320. U.A.Request(US.Config.pbl + "addLoginOperation", [_user.userid], function (res) {
  321. }, [], { "type": "POST", "withCredentials": true });
  322. if (res.value[0][0].organizeid == '91305d49-01ba-11ed-8c78-005056b86db4') {
  323. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/mingdeBg.png")'
  324. US.Config.background = 'url("/img/icon/mingdeBg.png")'
  325. } else if (res.value[0][0].organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263') {
  326. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhongshanBg.png")'
  327. US.Config.background = 'url("/img/icon/zhongshanBg.png")'
  328. } else if (res.value[0][0].organizeid == '580aac24-a939-49f7-a75a-40a7b5af3a17') {
  329. // $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longweiBg.png")'
  330. } else if (res.value[0][0].organizeid == 'b1095a3c-1d06-4ac8-854f-7c0d97f4ab41') {
  331. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yunhaiBg.jpg")'
  332. US.Config.background = 'url("/img/icon/yunhaiBg.png")'
  333. } else if (res.value[0][0].organizeid == '857af1c7-c8ee-4b04-85b5-fd182903adb7') {
  334. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/beijingBg.png")'
  335. US.Config.background = 'url("/img/icon/beijingBg.png")'
  336. } else if (res.value[0][0].organizeid == '69893dca-1d47-11ed-8c78-005056b86db5') {
  337. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/weilaiBg.png")'
  338. US.Config.background = 'url("/img/icon/weilaiBg.png")'
  339. } else if (res.value[0][0].organizeid == 'efdef564-4064-11ed-8c78-005056b86db5') {
  340. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/pz.jpg")'
  341. US.Config.background = 'url("/img/icon/pz.png")'
  342. } else if (res.value[0][0].organizeid == 'd9db3320-503a-11ed-8c78-005056b86db5') {
  343. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/hzBg.png")'
  344. US.Config.background = 'url("/img/icon/hzBg.png")'
  345. } else if (res.value[0][0].organizeid == 'ccb9754d-59c1-11ed-8c78-005056b86db5') {
  346. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  347. US.Config.background = 'url("/img/icon/nanfangBg.png")'
  348. } else if (res.value[0][0].organizeid == 'f30a6615-5379-11ed-8c78-005056b86db5') {
  349. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaBg.png")'
  350. US.Config.background = 'url("/img/icon/longhuaBg.png")'
  351. } else if (res.value[0][0].organizeid == '4787cc87-6588-11ed-8c78-005056b86db5') {
  352. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  353. US.Config.background = 'url("/img/icon/nanfangBg.png")'
  354. } else if (res.value[0][0].organizeid == '9f888eae-7558-11ed-8c78-005056b86db5') {
  355. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/song.png")'
  356. US.Config.background = 'url("/img/icon/song.png")'
  357. } else if (res.value[0][0].organizeid == '2b9ceb66-a1dd-11ed-b13d-005056b86db5') {
  358. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gmxxBg.png")'
  359. US.Config.background = 'url("/img/icon/gmxxBg.png")'
  360. } else if (res.value[0][0].organizeid == '1c3b9def-8fbe-11ed-b13d-005056b86db5') {
  361. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/wankeBg.png")'
  362. US.Config.background = 'url("/img/icon/wankeBg.png")'
  363. } else if (res.value[0][0].organizeid == '82fcb5c7-c13b-11ed-8d51-005056b86db5') {
  364. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qiaoxiangBg.png")'
  365. US.Config.background = 'url("/img/icon/qiaoxiangBg.png")'
  366. } else if (res.value[0][0].organizeid == '4c686762-1d0a-11ed-8c78-005056b86db5') {
  367. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/sies.png")'
  368. US.Config.background = 'url("/img/icon/sies.png")'
  369. } else if (res.value[0][0].organizeid == 'ea2a8c65-f38c-11ed-91d8-005056b86db5') {
  370. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaZXBg.png")'
  371. US.Config.background = 'url("/img/icon/longhuaZXBg.png")'
  372. } else if (res.value[0][0].organizeid == 'f297fbdc-f0a0-11ee-b534-005056b86db5') {
  373. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/010606.png")'
  374. US.Config.background = 'url("/img/icon/010606.png")'
  375. }
  376. if (res.value[0][0].org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f018d') {
  377. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yantianOrgBg.png")'
  378. US.Config.background = 'url("/img/icon/yantianOrgBg.png")'
  379. } else if (res.value[0][0].org == '7ada499f-4ec7-11ed-8c78-005056b86db5') {
  380. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/csteamBg.png")'
  381. US.Config.background = 'url("/img/icon/csteamBg.png")'
  382. } else if (res.value[0][0].org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217') {
  383. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gm/bg.png")'
  384. US.Config.background = 'url("/img/icon/bg.png")'
  385. U.MD.D.getNotice();
  386. } else if (res.value[0][0].org == '97c4ee8b-d010-4042-986d-e9d3c217264f') {
  387. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhoujia.jpg")'
  388. US.Config.background = 'url("/img/icon/zhoujia.png")'
  389. } else if (res.value[0][0].org == '150e3120-9195-11ed-b13d-005056b86db5') {
  390. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/tencentBg.jpg")'
  391. US.Config.background = 'url("/img/icon/tencentBg.png")'
  392. U.MD.D.getNotice();
  393. } else if (res.value[0][0].org == 'ee40e8e3-e36c-4872-8105-cf395481012s') {
  394. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szscBg.png")'
  395. US.Config.background = 'url("/img/icon/szscBg.png")'
  396. U.MD.D.getNotice();
  397. } else if (res.value[0][0].org == 'ec0af97a-7c10-4259-a7eb-db9cc8174cdc') {
  398. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/futianBg.png")'
  399. US.Config.background = 'url("/img/icon/futianBg.png")'
  400. } else if (res.value[0][0].org == 'e632b86c-f89d-11ed-91d8-005056b86db5') {
  401. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gdjgBg.png")'
  402. US.Config.background = 'url("/img/icon/gdjgBg.png")'
  403. } else if (res.value[0][0].org == '54f09f1e-09f0-11ee-91d8-005056b86db5') {
  404. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szlhyjBg.jpeg")'
  405. US.Config.background = 'url("/img/icon/szlhyjBg.jpeg")'
  406. } else if (res.value[0][0].org == '7b016f69-0f4f-11ee-91d8-005056b86db5') {
  407. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/dseiBg.png")'
  408. US.Config.background = 'url("/img/icon/dseiBg.png")'
  409. } else if (res.value[0][0].org == '1973f6c7-1561-11ee-91d8-005056b86db5') {
  410. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szjkyBg2.png")'
  411. US.Config.background = 'url("/img/icon/szjkyBg2.png")'
  412. } else if (res.value[0][0].org == '2fa75e51-189a-11ee-91d8-005056b86db5') {
  413. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/chjyjBg.png")'
  414. US.Config.background = 'url("/img/icon/chjyjBg.png")'
  415. } else if (res.value[0][0].org == '2a9f32ea-88df-49eb-aba1-0a286f691474') {
  416. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qhBg.jpg")'
  417. US.Config.background = 'url("/img/icon/qhBg.jpg")'
  418. } else if (res.value[0][0].org == '884c5665-a453-46f3-b7b6-01d575290aa9') {
  419. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/scnuaiBg.png")'
  420. US.Config.background = 'url("/img/icon/scnuaiBg.png")'
  421. } else if (res.value[0][0].org == '2fe1a080-4425-4620-b7a0-be2f3750ffd4') {
  422. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/x010607bgImg.png")'
  423. US.Config.background = 'url("/img/icon/x010607bgImg.png")'
  424. }
  425. US.userInfo = res.value[0][0];
  426. $(".avatar")[0].style.display = "block";
  427. if(res.value[0][0].type === 1 && $(".U_PBL_Check")[0] && res.value[0][0].org != '150e3120-9195-11ed-b13d-005056b86db5'){
  428. $(".U_PBL_Check")[0].style.display = "block";
  429. }
  430. }
  431. $(".login")[0].style.display = "none";
  432. $(".register")[0].style.display = "none";
  433. $(".userName")[0].style.display = "block";
  434. $(".userName")[0].innerHTML = US.userInfo.username || US.userInfo.alias;
  435. $(".exit")[0].style.display = "block";
  436. if(res.value[0][0].type === 1 && res.value[0][0].org == 'c95e0a56-c205-11ed-8d51-005056b86db5'){
  437. U.MD.D.I.ModeCheck(2)
  438. }else{
  439. U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0], 1);
  440. }
  441. let shareCourseId = window.location.href.indexOf("?shareCourseId=")!=-1?window.location.href.split("?shareCourseId=")[1].toString():''
  442. if(shareCourseId){
  443. console.log(shareCourseId);
  444. U.MD.D.I.openInApplication("studyDetail", shareCourseId, 5, 1)
  445. }
  446. if(res.value[0][0].type === 1 && window.location.hash.indexOf('project') != -1){
  447. U.MD.D.I.openApplication("project")
  448. }
  449. if(res.value[0][0].type === 1 && window.location.hash.indexOf('study') != -1){
  450. U.MD.D.I.openApplication("study")
  451. }
  452. if(res.value[0][0].type === 2 && window.location.hash.indexOf('study') != -1){
  453. U.MD.D.I.openApplication("studentStudy")
  454. }
  455. U.MD.O.P.connect(); //登录成功后连接socket服务同步协同编辑
  456. }, [], { "type": "GET", "withCredentials": true });
  457. }
  458. }, [], { "type": "GET", "withCredentials": true });
  459. }
  460. }, [], { "type": "GET", "withCredentials": true });
  461. }
  462. }else if(!LoginState &&Object.keys(userInfo).length === 0 && U.UF.C.queryString('code').length === 32){
  463. if($("#U_MD_HomeC_Pop")[0]){
  464. $("#U_MD_HomeC_Pop")[0].close()
  465. }
  466. LoginState = true
  467. // console.log('新华跳转',U.UF.C.queryString('code'))
  468. let url = "https://cloud.cocorobo.cn/api/getTeacherInfoByCode"
  469. var myHeaders = new Headers();
  470. // myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
  471. myHeaders.append("Content-Type", "application/json");
  472. // myHeaders.append("Access-Control-Allow-Origin","*")
  473. var raw = JSON.stringify({
  474. "code": U.UF.C.queryString('code')
  475. });
  476. var requestOptions = {
  477. method: 'POST',
  478. headers: myHeaders,
  479. body: raw,
  480. redirect: 'follow'
  481. };
  482. fetch(url, requestOptions)
  483. .then(response => response.text())
  484. .then(result => {
  485. // console.log(result)
  486. let data = JSON.parse(result).data
  487. if(JSON.parse(result).code == 200){
  488. let diqu = `${data.province}-${data.city}-${data.county}-${data.street}-${data.schoolName}`
  489. let diquId = data.schoolId
  490. U.A.Request(US.Config.pbl + "batchRegistrationSzdjg3", [data.realName, data.userUniqueId+"@xhly.com", 'a5efd078-20f6-4185-bef9-6d1c688bee70', data.schoolName || "", "", "", 1, data.userUniqueId,diqu,diquId], function (res) {
  491. // console.log(res);
  492. let loginData = JSON.stringify({
  493. openid: data.userUniqueId,
  494. edu: true
  495. })
  496. var requestOptionsLogin = {
  497. method: 'POST',
  498. headers: myHeaders,
  499. body: loginData,
  500. redirect: 'follow'
  501. };
  502. fetch("https://beta.api.cocorobo.cn/api/user", requestOptionsLogin)
  503. .then(response => response.text())
  504. .then(result => {
  505. let a = JSON.parse(result)
  506. if(a.length>0){
  507. let userId = a[0][0].userid
  508. US.userInfo.userid = userId
  509. U.A.Request(US.Config.pbl + "selectUser?userid=" + userId, [], function (res) { //US.userInfo.userid
  510. if (res.value == null || res.value[0].length == 0) {
  511. // U.MD.D.I.openApplication("my")
  512. let _name = US.userInfo.alias ? US.userInfo.alias : US.userInfo.username
  513. let _type = US.userInfo == 1 ? 2 : 1
  514. // US.Config.pbl
  515. // "http://localhost:7003/api/pbl/"
  516. U.A.Request(US.Config.pbl + "updatePblMessage", [userId, _name, _type, '16d397f3-b192-11ed-9211-005056b86db5', '', '', "0"], function (res) {
  517. window.location.reload();
  518. }, [], { "type": "POST", "withCredentials": true });
  519. } else {
  520. if(res.value[0][0].isLogin1 == 2 || res.value[0][0].isLogin2 == 2){
  521. U.MD.U.LO.logoutSystem2();
  522. return;
  523. }
  524. U.A.Request(US.Config.pbl + "addLoginOperation", [userId], function (res) {
  525. }, [], { "type": "POST", "withCredentials": true });
  526. if (res.value[0][0].organizeid == '91305d49-01ba-11ed-8c78-005056b86db4') {
  527. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/mingdeBg.png")'
  528. US.Config.background = 'url("/img/icon/mingdeBg.png")'
  529. } else if (res.value[0][0].organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263') {
  530. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhongshanBg.png")'
  531. US.Config.background = 'url("/img/icon/zhongshanBg.png")'
  532. } else if (res.value[0][0].organizeid == '580aac24-a939-49f7-a75a-40a7b5af3a17') {
  533. // $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longweiBg.png")'
  534. } else if (res.value[0][0].organizeid == 'b1095a3c-1d06-4ac8-854f-7c0d97f4ab41') {
  535. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yunhaiBg.jpg")'
  536. US.Config.background = 'url("/img/icon/yunhaiBg.png")'
  537. } else if (res.value[0][0].organizeid == '857af1c7-c8ee-4b04-85b5-fd182903adb7') {
  538. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/beijingBg.png")'
  539. US.Config.background = 'url("/img/icon/beijingBg.png")'
  540. } else if (res.value[0][0].organizeid == '69893dca-1d47-11ed-8c78-005056b86db5') {
  541. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/weilaiBg.png")'
  542. US.Config.background = 'url("/img/icon/weilaiBg.png")'
  543. } else if (res.value[0][0].organizeid == 'efdef564-4064-11ed-8c78-005056b86db5') {
  544. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/pz.jpg")'
  545. US.Config.background = 'url("/img/icon/pz.png")'
  546. } else if (res.value[0][0].organizeid == 'd9db3320-503a-11ed-8c78-005056b86db5') {
  547. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/hzBg.png")'
  548. US.Config.background = 'url("/img/icon/hzBg.png")'
  549. } else if (res.value[0][0].organizeid == 'ccb9754d-59c1-11ed-8c78-005056b86db5') {
  550. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  551. US.Config.background = 'url("/img/icon/nanfangBg.png")'
  552. } else if (res.value[0][0].organizeid == 'f30a6615-5379-11ed-8c78-005056b86db5') {
  553. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaBg.png")'
  554. US.Config.background = 'url("/img/icon/longhuaBg.png")'
  555. } else if (res.value[0][0].organizeid == '4787cc87-6588-11ed-8c78-005056b86db5') {
  556. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  557. US.Config.background = 'url("/img/icon/nanfangBg.png")'
  558. } else if (res.value[0][0].organizeid == '9f888eae-7558-11ed-8c78-005056b86db5') {
  559. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/song.png")'
  560. US.Config.background = 'url("/img/icon/song.png")'
  561. } else if (res.value[0][0].organizeid == '2b9ceb66-a1dd-11ed-b13d-005056b86db5') {
  562. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gmxxBg.png")'
  563. US.Config.background = 'url("/img/icon/gmxxBg.png")'
  564. } else if (res.value[0][0].organizeid == '1c3b9def-8fbe-11ed-b13d-005056b86db5') {
  565. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/wankeBg.png")'
  566. US.Config.background = 'url("/img/icon/wankeBg.png")'
  567. } else if (res.value[0][0].organizeid == '82fcb5c7-c13b-11ed-8d51-005056b86db5') {
  568. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qiaoxiangBg.png")'
  569. US.Config.background = 'url("/img/icon/qiaoxiangBg.png")'
  570. } else if (res.value[0][0].organizeid == '4c686762-1d0a-11ed-8c78-005056b86db5') {
  571. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/sies.png")'
  572. US.Config.background = 'url("/img/icon/sies.png")'
  573. } else if (res.value[0][0].organizeid == 'ea2a8c65-f38c-11ed-91d8-005056b86db5') {
  574. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaZXBg.png")'
  575. US.Config.background = 'url("/img/icon/longhuaZXBg.png")'
  576. } else if (res.value[0][0].organizeid == 'f297fbdc-f0a0-11ee-b534-005056b86db5') {
  577. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/010606.png")'
  578. US.Config.background = 'url("/img/icon/010606.png")'
  579. }
  580. if (res.value[0][0].org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f018d') {
  581. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yantianOrgBg.png")'
  582. US.Config.background = 'url("/img/icon/yantianOrgBg.png")'
  583. } else if (res.value[0][0].org == '7ada499f-4ec7-11ed-8c78-005056b86db5') {
  584. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/csteamBg.png")'
  585. US.Config.background = 'url("/img/icon/csteamBg.png")'
  586. } else if (res.value[0][0].org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217') {
  587. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gm/bg.png")'
  588. US.Config.background = 'url("/img/icon/bg.png")'
  589. U.MD.D.getNotice();
  590. } else if (res.value[0][0].org == '97c4ee8b-d010-4042-986d-e9d3c217264f') {
  591. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhoujia.jpg")'
  592. US.Config.background = 'url("/img/icon/zhoujia.png")'
  593. } else if (res.value[0][0].org == '150e3120-9195-11ed-b13d-005056b86db5') {
  594. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/tencentBg.jpg")'
  595. US.Config.background = 'url("/img/icon/tencentBg.png")'
  596. U.MD.D.getNotice();
  597. } else if (res.value[0][0].org == 'ee40e8e3-e36c-4872-8105-cf395481012s') {
  598. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szscBg.png")'
  599. US.Config.background = 'url("/img/icon/szscBg.png")'
  600. U.MD.D.getNotice();
  601. } else if (res.value[0][0].org == 'ec0af97a-7c10-4259-a7eb-db9cc8174cdc') {
  602. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/futianBg.png")'
  603. US.Config.background = 'url("/img/icon/futianBg.png")'
  604. } else if (res.value[0][0].org == 'e632b86c-f89d-11ed-91d8-005056b86db5') {
  605. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gdjgBg.png")'
  606. US.Config.background = 'url("/img/icon/gdjgBg.png")'
  607. } else if (res.value[0][0].org == '54f09f1e-09f0-11ee-91d8-005056b86db5') {
  608. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szlhyjBg.jpeg")'
  609. US.Config.background = 'url("/img/icon/szlhyjBg.jpeg")'
  610. } else if (res.value[0][0].org == '7b016f69-0f4f-11ee-91d8-005056b86db5') {
  611. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/dseiBg.png")'
  612. US.Config.background = 'url("/img/icon/dseiBg.png")'
  613. } else if (res.value[0][0].org == '1973f6c7-1561-11ee-91d8-005056b86db5') {
  614. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szjkyBg2.png")'
  615. US.Config.background = 'url("/img/icon/szjkyBg2.png")'
  616. } else if (res.value[0][0].org == '2fa75e51-189a-11ee-91d8-005056b86db5') {
  617. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/chjyjBg.png")'
  618. US.Config.background = 'url("/img/icon/chjyjBg.png")'
  619. } else if (res.value[0][0].org == '2a9f32ea-88df-49eb-aba1-0a286f691474') {
  620. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qhBg.jpg")'
  621. US.Config.background = 'url("/img/icon/qhBg.jpg")'
  622. } else if (res.value[0][0].org == '884c5665-a453-46f3-b7b6-01d575290aa9') {
  623. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/scnuaiBg.png")'
  624. US.Config.background = 'url("/img/icon/scnuaiBg.png")'
  625. } else if (res.value[0][0].org == '2fe1a080-4425-4620-b7a0-be2f3750ffd4') {
  626. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/x010607bgImg.png")'
  627. US.Config.background = 'url("/img/icon/x010607bgImg.png")'
  628. }
  629. US.userInfo = res.value[0][0];
  630. $(".avatar")[0].style.display = "block";
  631. if(res.value[0][0].type === 1 && $(".U_PBL_Check")[0] && res.value[0][0].org != '150e3120-9195-11ed-b13d-005056b86db5'){
  632. $(".U_PBL_Check")[0].style.display = "block";
  633. }
  634. }
  635. $(".login")[0].style.display = "none";
  636. $(".register")[0].style.display = "none";
  637. $(".userName")[0].style.display = "block";
  638. $(".userName")[0].innerHTML = US.userInfo.username || US.userInfo.alias;
  639. $(".exit")[0].style.display = "block";
  640. if(res.value[0][0].type === 1 && res.value[0][0].org == 'c95e0a56-c205-11ed-8d51-005056b86db5'){
  641. U.MD.D.I.ModeCheck(2)
  642. }else{
  643. U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0], 1);
  644. }
  645. let shareCourseId = window.location.href.indexOf("?shareCourseId=")!=-1?window.location.href.split("?shareCourseId=")[1].toString():''
  646. if(shareCourseId){
  647. console.log(shareCourseId);
  648. U.MD.D.I.openInApplication("studyDetail", shareCourseId, 5, 1)
  649. }
  650. if(res.value[0][0].type === 1 && window.location.hash.indexOf('project') != -1){
  651. U.MD.D.I.openApplication("project")
  652. }
  653. if(res.value[0][0].type === 1 && window.location.hash.indexOf('study') != -1){
  654. U.MD.D.I.openApplication("study")
  655. }
  656. if(res.value[0][0].type === 2 && window.location.hash.indexOf('study') != -1){
  657. U.MD.D.I.openApplication("studentStudy")
  658. }
  659. U.MD.O.P.connect(); //登录成功后连接socket服务同步协同编辑
  660. }, [], { "type": "GET", "withCredentials": true });
  661. }
  662. })
  663. .catch(error => {
  664. LoginState = false
  665. console.log('error', error)
  666. });
  667. }, [], { "type": "POST", "withCredentials": true })
  668. }else{
  669. U.Alert("用户登录已失效,请重新获取登录信息!");
  670. }
  671. })
  672. .catch(error => {
  673. LoginState = false
  674. console.log('error', error)
  675. });
  676. } else if(Object.keys(userInfo).length !== 0){
  677. if(US.Config.type == '2'){
  678. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/easyBg.png")'
  679. if (userInfo.org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217') {
  680. U.MD.D.getNotice();
  681. }else if (userInfo.org == '150e3120-9195-11ed-b13d-005056b86db5') {
  682. U.MD.D.getNotice();
  683. } else if (userInfo.org == 'ee40e8e3-e36c-4872-8105-cf395481012s') {
  684. U.MD.D.getNotice();
  685. }
  686. }else{
  687. if (userInfo.organizeid == '91305d49-01ba-11ed-8c78-005056b86db4') {
  688. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/mingdeBg.png")'
  689. } else if (userInfo.organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263') {
  690. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhongshanBg.png")'
  691. } else if (userInfo.organizeid == '580aac24-a939-49f7-a75a-40a7b5af3a17') {
  692. // $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longweiBg.png")'
  693. } else if (userInfo.organizeid == 'b1095a3c-1d06-4ac8-854f-7c0d97f4ab41') {
  694. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yunhaiBg.jpg")'
  695. } else if (userInfo.organizeid == '857af1c7-c8ee-4b04-85b5-fd182903adb7') {
  696. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/beijingBg.png")'
  697. } else if (userInfo.organizeid == '69893dca-1d47-11ed-8c78-005056b86db5') {
  698. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/weilaiBg.png")'
  699. } else if (userInfo.organizeid == 'efdef564-4064-11ed-8c78-005056b86db5') {
  700. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/pz.jpg")'
  701. } else if (userInfo.organizeid == 'd9db3320-503a-11ed-8c78-005056b86db5') {
  702. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/hzBg.png")'
  703. } else if (userInfo.organizeid == 'ccb9754d-59c1-11ed-8c78-005056b86db5') {
  704. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  705. } else if (userInfo.organizeid == 'f30a6615-5379-11ed-8c78-005056b86db5') {
  706. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaBg.png")'
  707. } else if (userInfo.organizeid == '4787cc87-6588-11ed-8c78-005056b86db5') {
  708. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  709. } else if (userInfo.organizeid == '9f888eae-7558-11ed-8c78-005056b86db5') {
  710. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/song.png")'
  711. } else if (userInfo.organizeid == '2b9ceb66-a1dd-11ed-b13d-005056b86db5') {
  712. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gmxxBg.png")'
  713. } else if (userInfo.organizeid == '1c3b9def-8fbe-11ed-b13d-005056b86db5') {
  714. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/wankeBg.png")'
  715. } else if (userInfo.organizeid == '82fcb5c7-c13b-11ed-8d51-005056b86db5') {
  716. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qiaoxiangBg.png")'
  717. } else if (userInfo.organizeid == '4c686762-1d0a-11ed-8c78-005056b86db5') {
  718. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/sies.png")'
  719. } else if (userInfo.organizeid == 'ea2a8c65-f38c-11ed-91d8-005056b86db5') {
  720. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaZXBg.png")'
  721. } else if (userInfo.organizeid == 'f297fbdc-f0a0-11ee-b534-005056b86db5') {
  722. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/010606.png")'
  723. }
  724. if (userInfo.org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f018d') {
  725. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yantianOrgBg.png")'
  726. } else if (userInfo.org == '7ada499f-4ec7-11ed-8c78-005056b86db5') {
  727. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/csteamBg.png")'
  728. } else if (userInfo.org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217') {
  729. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gm/bg.png")'
  730. U.MD.D.getNotice();
  731. } else if (userInfo.org == '97c4ee8b-d010-4042-986d-e9d3c217264f') {
  732. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhoujia.jpg")'
  733. } else if (userInfo.org == '150e3120-9195-11ed-b13d-005056b86db5') {
  734. if (!$("#tc_desktop_css")[0]) {
  735. const link = document.createElement("link");
  736. link.rel = "stylesheet";
  737. link.href =
  738. "./css/tencent/Desktop.css";
  739. link.id = "tc_desktop_css"
  740. document.body.appendChild(link);
  741. $(".avatar")[0].onclick= function(){
  742. U.MD.D.I.openApplication('tcData')
  743. }
  744. }
  745. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/tencentBg.jpg")'
  746. U.MD.D.getNotice();
  747. } else if (userInfo.org == 'ee40e8e3-e36c-4872-8105-cf395481012s') {
  748. $(".avatar")[0].onclick= function(){
  749. U.MD.D.I.openApplication('tcData')
  750. }
  751. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szscBg.png")'
  752. U.MD.D.getNotice();
  753. } else if (userInfo.org == 'ec0af97a-7c10-4259-a7eb-db9cc8174cdc') {
  754. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/futianBg.png")'
  755. } else if (userInfo.org == 'e632b86c-f89d-11ed-91d8-005056b86db5') {
  756. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gdjgBg.png")'
  757. } else if (userInfo.org == '54f09f1e-09f0-11ee-91d8-005056b86db5') {
  758. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szlhyjBg.jpeg")'
  759. } else if (userInfo.org == '7b016f69-0f4f-11ee-91d8-005056b86db5') {
  760. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/dseiBg.png")'
  761. } else if (userInfo.org == '1973f6c7-1561-11ee-91d8-005056b86db5') {
  762. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szjkyBg2.png")'
  763. } else if (userInfo.org == '2fa75e51-189a-11ee-91d8-005056b86db5') {
  764. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/chjyjBg.png")'
  765. } else if (userInfo.org == '2a9f32ea-88df-49eb-aba1-0a286f691474') {
  766. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qhBg.jpg")'
  767. } else if (userInfo.org == '884c5665-a453-46f3-b7b6-01d575290aa9') {
  768. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/scnuaiBg.png")'
  769. } else if (userInfo.org == '2fe1a080-4425-4620-b7a0-be2f3750ffd4') {
  770. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/x010607bgImg.png")'
  771. }
  772. }
  773. }
  774. }
  775. U.MD.D.addLoginTime = function(){
  776. var userInfo = US.userInfo;
  777. if(Object.keys(userInfo).length !== 0){
  778. U.A.Request(US.Config.pbl + "addOperationTimeT", [userInfo.userid,'','3','600'], function (res) {
  779. }, [], { "type": "POST", "withCredentials": true });
  780. }
  781. }
  782. U.MD.D.getuser2 = function (userid, cid) {
  783. U.A.Request(US.Config.pbl + "selectUser?userid=" + userid, [], function (res) { //US.userInfo.userid
  784. if ($("#U_MD_HomeC_Pop")[0]) {
  785. $("#U_MD_HomeC_Pop")[0].close(); //關閉登陸
  786. }
  787. if(res.value[0][0].isLogin1 == 2 || res.value[0][0].isLogin2 == 2){
  788. U.MD.U.LO.logoutSystem2();
  789. return;
  790. }
  791. U.A.Request(US.Config.pbl + "addLoginOperation", [userid], function (res) {
  792. }, [], { "type": "POST", "withCredentials": true });
  793. if (res.value[0][0].organizeid == '91305d49-01ba-11ed-8c78-005056b86db4') {
  794. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/mingdeBg.png")'
  795. US.Config.background = 'url("/img/icon/mingdeBg.png")'
  796. } else if (res.value[0][0].organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263') {
  797. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhongshanBg.png")'
  798. US.Config.background = 'url("/img/icon/zhongshanBg.png")'
  799. } else if (res.value[0][0].organizeid == '580aac24-a939-49f7-a75a-40a7b5af3a17') {
  800. // $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longweiBg.png")'
  801. } else if (res.value[0][0].organizeid == 'b1095a3c-1d06-4ac8-854f-7c0d97f4ab41') {
  802. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yunhaiBg.jpg")'
  803. US.Config.background = 'url("/img/icon/yunhaiBg.png")'
  804. } else if (res.value[0][0].organizeid == '857af1c7-c8ee-4b04-85b5-fd182903adb7') {
  805. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/beijingBg.png")'
  806. US.Config.background = 'url("/img/icon/beijingBg.png")'
  807. } else if (res.value[0][0].organizeid == '69893dca-1d47-11ed-8c78-005056b86db5') {
  808. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/weilaiBg.png")'
  809. US.Config.background = 'url("/img/icon/weilaiBg.png")'
  810. } else if (res.value[0][0].organizeid == 'efdef564-4064-11ed-8c78-005056b86db5') {
  811. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/pz.jpg")'
  812. US.Config.background = 'url("/img/icon/pz.png")'
  813. } else if (res.value[0][0].organizeid == 'd9db3320-503a-11ed-8c78-005056b86db5') {
  814. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/hzBg.png")'
  815. US.Config.background = 'url("/img/icon/hzBg.png")'
  816. } else if (res.value[0][0].organizeid == 'ccb9754d-59c1-11ed-8c78-005056b86db5') {
  817. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  818. US.Config.background = 'url("/img/icon/nanfangBg.png")'
  819. } else if (res.value[0][0].organizeid == 'f30a6615-5379-11ed-8c78-005056b86db5') {
  820. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaBg.png")'
  821. US.Config.background = 'url("/img/icon/longhuaBg.png")'
  822. } else if (res.value[0][0].organizeid == '4787cc87-6588-11ed-8c78-005056b86db5') {
  823. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/nanfangBg.png")'
  824. US.Config.background = 'url("/img/icon/nanfangBg.png")'
  825. } else if (res.value[0][0].organizeid == '9f888eae-7558-11ed-8c78-005056b86db5') {
  826. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/song.png")'
  827. US.Config.background = 'url("/img/icon/song.png")'
  828. } else if (res.value[0][0].organizeid == '2b9ceb66-a1dd-11ed-b13d-005056b86db5') {
  829. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gmxxBg.png")'
  830. US.Config.background = 'url("/img/icon/gmxxBg.png")'
  831. } else if (res.value[0][0].organizeid == '1c3b9def-8fbe-11ed-b13d-005056b86db5') {
  832. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/wankeBg.png")'
  833. US.Config.background = 'url("/img/icon/wankeBg.png")'
  834. } else if (res.value[0][0].organizeid == '82fcb5c7-c13b-11ed-8d51-005056b86db5') {
  835. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qiaoxiangBg.png")'
  836. US.Config.background = 'url("/img/icon/qiaoxiangBg.png")'
  837. } else if (res.value[0][0].organizeid == '4c686762-1d0a-11ed-8c78-005056b86db5') {
  838. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/sies.png")'
  839. } else if (res.value[0][0].organizeid == 'ea2a8c65-f38c-11ed-91d8-005056b86db5') {
  840. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longhuaZXBg.png")'
  841. } else if (res.value[0][0].organizeid == 'f297fbdc-f0a0-11ee-b534-005056b86db5') {
  842. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/010606.png")'
  843. }
  844. if (res.value[0][0].org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f018d') {
  845. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/yantianOrgBg.png")'
  846. US.Config.background = 'url("/img/icon/yantianOrgBg.png")'
  847. } else if (res.value[0][0].org == '7ada499f-4ec7-11ed-8c78-005056b86db5') {
  848. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/csteamBg.png")'
  849. US.Config.background = 'url("/img/icon/csteamBg.png")'
  850. } else if (res.value[0][0].org == 'eb2af5e9-ac3d-46b6-9fe3-3c1c364f0217') {
  851. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gm/bg.png")'
  852. US.Config.background = 'url("/img/icon/bg.png")'
  853. U.MD.D.getNotice();
  854. } else if (res.value[0][0].org == '97c4ee8b-d010-4042-986d-e9d3c217264f') {
  855. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhoujia.jpg")'
  856. US.Config.background = 'url("/img/icon/zhoujia.png")'
  857. } else if (res.value[0][0].org == '150e3120-9195-11ed-b13d-005056b86db5') {
  858. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/tencentBg.jpg")'
  859. US.Config.background = 'url("/img/icon/tencentBg.png")'
  860. U.MD.D.getNotice();
  861. } else if (res.value[0][0].org == 'ee40e8e3-e36c-4872-8105-cf395481012s') {
  862. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szscBg.png")'
  863. US.Config.background = 'url("/img/icon/szscBg.png")'
  864. U.MD.D.getNotice();
  865. } else if (res.value[0][0].org == 'ec0af97a-7c10-4259-a7eb-db9cc8174cdc') {
  866. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/futianBg.png")'
  867. US.Config.background = 'url("/img/icon/futianBg.png")'
  868. } else if (res.value[0][0].org == 'e632b86c-f89d-11ed-91d8-005056b86db5') {
  869. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gdjgBg.png")'
  870. US.Config.background = 'url("/img/icon/gdjgBg.png")'
  871. } else if (res.value[0][0].org == '54f09f1e-09f0-11ee-91d8-005056b86db5') {
  872. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szlhyjBg.jpeg")'
  873. US.Config.background = 'url("/img/icon/szlhyjBg.jpeg")'
  874. } else if (res.value[0][0].org == '7b016f69-0f4f-11ee-91d8-005056b86db5') {
  875. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/dseiBg.png")'
  876. US.Config.background = 'url("/img/icon/dseiBg.png")'
  877. } else if (res.value[0][0].org == '1973f6c7-1561-11ee-91d8-005056b86db5') {
  878. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/szjkyBg2.png")'
  879. US.Config.background = 'url("/img/icon/szjkyBg2.png")'
  880. } else if (res.value[0][0].org == '2fa75e51-189a-11ee-91d8-005056b86db5') {
  881. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/chjyjBg.png")'
  882. US.Config.background = 'url("/img/icon/chjyjBg.png")'
  883. } else if (res.value[0][0].org == '2a9f32ea-88df-49eb-aba1-0a286f691474') {
  884. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/qhBg.jpg")'
  885. US.Config.background = 'url("/img/icon/qhBg.jpg")'
  886. } else if (res.value[0][0].org == '884c5665-a453-46f3-b7b6-01d575290aa9') {
  887. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/scnuaiBg.png")'
  888. US.Config.background = 'url("/img/icon/scnuaiBg.png")'
  889. } else if (res.value[0][0].org == '2fe1a080-4425-4620-b7a0-be2f3750ffd4') {
  890. $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/x010607bgImg.png")'
  891. US.Config.background = 'url("/img/icon/x010607bgImg.png")'
  892. }
  893. US.userInfo = res.value[0][0];
  894. $(".avatar")[0].style.display = "block";
  895. if (res.value[0][0].type === 1 && $(".U_PBL_Check")[0] && res.value[0][0].org != '150e3120-9195-11ed-b13d-005056b86db5') {
  896. $(".U_PBL_Check")[0].style.display = "block";
  897. }
  898. $(".login")[0].style.display = "none";
  899. $(".register")[0].style.display = "none";
  900. $(".userName")[0].style.display = "block";
  901. $(".userName")[0].innerHTML = US.userInfo.username || US.userInfo.alias;
  902. $(".exit")[0].style.display = "block";
  903. if(res.value[0][0].type === 1 && res.value[0][0].org == 'c95e0a56-c205-11ed-8d51-005056b86db5'){
  904. U.MD.D.I.ModeCheck(2)
  905. }else{
  906. U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0], 1);
  907. }
  908. if(res.value[0][0].type === 1 && window.location.hash.indexOf('project') != -1){
  909. U.MD.D.I.openApplication("project")
  910. }
  911. if(res.value[0][0].type === 1 && window.location.hash.indexOf('study') != -1){
  912. U.MD.D.I.openApplication("study")
  913. }
  914. if(res.value[0][0].type === 2 && window.location.hash.indexOf('study') != -1){
  915. U.MD.D.I.openApplication("studentStudy")
  916. }
  917. U.MD.O.P.connect(); //登录成功后连接socket服务同步协同编辑
  918. U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
  919. }, [], { "type": "GET", "withCredentials": true });
  920. }
  921. //#endregion
  922. //#region 獲取ifram下的html
  923. //U.MD.D.getIfraemHtml = function (src) {
  924. // var _iframe = $$("iframe", { src: src, style: { display: "none"} });
  925. // //跨域回調設置
  926. // U.UF.DL.iframeLoad(_iframe, function () {
  927. // var _html = _iframe.contentWindow.document.body.innerHTML;
  928. // console.log(_html);
  929. // U.selectEl(_iframe).remove();
  930. // });
  931. // U.selectEl(_iframe).appendTo($('body')[0]);
  932. //};
  933. //#endregion
  934. U.MD.D.fullscreen = function () {
  935. //if (document.body.offsetWidth < 1025) {
  936. U.UF.C.fullScreen()
  937. //}
  938. document.body.addEventListener('dblclick', () => {
  939. U.UF.C.fullScreen()
  940. // const isFullScreen = document.fullscreenElement
  941. // if (isFullScreen) {
  942. // U.UF.C.cancelfullScreen()
  943. // } else {
  944. // U.UF.C.fullScreen()
  945. // }
  946. })
  947. }
  948. U.MD.D.stopSafari = function () {
  949. //阻止safari瀏覽器雙擊放大功能
  950. let lastTouchEnd = 0 //更新手指彈起的時間
  951. document.documentElement.addEventListener("touchstart", function (event) {
  952. //多根手指同時按下屏幕,禁止默認行為
  953. if (event.touches.length > 1) {
  954. event.preventDefault();
  955. }
  956. });
  957. document.documentElement.addEventListener("touchend", function (event) {
  958. let now = (new Date()).getTime();
  959. if (now - lastTouchEnd <= 300) {
  960. //當兩次手指彈起的時間小於300毫秒,認為雙擊屏幕行為
  961. event.preventDefault();
  962. } else { // 否則重新手指彈起的時間
  963. lastTouchEnd = now;
  964. }
  965. }, false);
  966. //阻止雙指放大頁面
  967. document.documentElement.addEventListener("gesturestart", function (event) {
  968. event.preventDefault();
  969. });
  970. }
  971. U.MD.D.noticeBlock = '1'
  972. U.MD.D.OpenNotice = function () {
  973. let box = $('.U_MD_D_BD_notice')[0]
  974. box.style.display = 'block'
  975. }
  976. U.MD.D.cancelNotice = function () {
  977. U.UF.EV.stopBubble();
  978. let box = $('.U_MD_D_BD_notice')[0]
  979. box.style.display = 'none'
  980. U.MD.D.noticeBlock = '2'
  981. }
  982. U.MD.D.getNotice = function () {
  983. // a77e9404-efec-11e9-96f9-028edca3b798&oid=45facc0a-1211-11ec-80ad-005056b86db5&org=undefined&role=1
  984. var uid = US.userInfo.userid,
  985. oid = US.userInfo.organizeid,
  986. org = US.userInfo.org;
  987. U.A.Request(US.Config.pbl + "selectNotice?uid=" + uid + "&oid=" + oid + "&org=" + org + "&page=1", [], function (res) {
  988. if (res.value && res.value[0].length > 0) {
  989. let box = $('.U_MD_D_BD_noticeBox_box')[0]
  990. let _res = res.value[0]
  991. if (U.MD.D.noticeBlock == '1') {
  992. $('.U_MD_D_BD_notice')[0].style.display = 'block'
  993. }
  994. $('.U_MD_D_BD_notice_img')[0].style.display = 'block'
  995. box.innerHTML = ''
  996. var num = _res.length > 3 ? 3 : _res.length
  997. for (var i = 0; i < num; i++) {
  998. var _box = $$('div', { className: 'U_MD_D_BD_noticeBox' }, box)
  999. var _title = $$('div', { className: 'U_MD_D_BD_noticeBox_title' }, _box)
  1000. // $$('span', { innerHTML: '消息通知' }, _title)
  1001. $$('span', { innerHTML: _res[i].title }, _title)
  1002. var _content = $$('div', { className: 'U_MD_D_BD_noticeBox_content' }, _box)
  1003. $$('span', { innerHTML: _res[i].content.replace(/<[^>]*>/g, "") }, _content)
  1004. var _time = $$('div', { className: 'U_MD_D_BD_noticeBox_time' }, _box)
  1005. $$('span', { innerHTML: _res[i].creatTime }, _time)
  1006. }
  1007. } else {
  1008. $('.U_MD_D_BD_notice')[0].style.display = 'none'
  1009. $('.U_MD_D_BD_notice_img')[0].style.display = 'none'
  1010. }
  1011. // setTimeout(() => {
  1012. // U.MD.D.getNotice();
  1013. // }, 5000);
  1014. }, [], { "type": "GET", "withCredentials": true });
  1015. }
  1016. // // 創建 video 元素並設置屬性
  1017. // const video = document.createElement("video");
  1018. // video.src = "../../img/icon/video/mxStart.mp4";
  1019. // video.autoplay = true;
  1020. // video.muted = true;
  1021. // video.style="width: 100%;"
  1022. // // 添加 video 元素到頁面
  1023. // document.body.appendChild(video);
  1024. // // 在視頻播放完成後刪除 video 元素
  1025. // video.addEventListener("ended", () => {
  1026. // document.body.removeChild(video);
  1027. // });