lsc 5 днів тому
батько
коміт
ed7f44a2a0
2 змінених файлів з 44 додано та 14 видалено
  1. 15 1
      js/Desktop/DeskTop.js
  2. 29 13
      js/Desktop/Onload.js

+ 15 - 1
js/Desktop/DeskTop.js

@@ -222,6 +222,7 @@ U.MD.D.I.orgStemDeskIcon = [
     // { "Name": "jupyter", "Url": "jupyter", "style": { "cssText": "background-image:url(/img/icon/jupyter.png)" } },
     { "Name": "综合看板", "Url": "dataBoardNew", "style": { "cssText": "background-image:url(/img/icon/dataBoardNew.png)" } },
     { "Name": "AI助手+", "Url": "aigpt", "style": { "cssText": "background-image:url(/img/icon/aigpt.png)" } },
+    { "Name": "CocoFlow", "Url": "appStore", "style": { "cssText": "background-image:url(/img/icon/appStore.png)" } },
 ];
 
 U.MD.D.I.szulsDeskIcon = [
@@ -2246,7 +2247,7 @@ U.MD.D.I.initDesktopIcons = function (el, type) {
         )
         _easyDesktopIconInfo.push({ "Name": "AI共创", "Url": "AIChat", "style": { "cssText": "background-image:url(/img/icon/AIChat.png)", "width": '114px', 'height': '114px' } })
     }
-    if (_oid == '45facc0a-1211-11ec-80ad-005056b86db5' || _org == '0fec3a8a-ad04-11ed-b13d-005056b86db5' || _org == '4d3812ef-fa66-11ef-b508-005056924926' || _oid == "0df61e4c-fe2d-11ef-b508-005056924926" || _org == 'eaee75a4-ff2e-11ef-b508-005056924926') {
+    if (_oid == '45facc0a-1211-11ec-80ad-005056b86db5' || _org == '0fec3a8a-ad04-11ed-b13d-005056b86db5' || _org == '4d3812ef-fa66-11ef-b508-005056924926' || _oid == "0df61e4c-fe2d-11ef-b508-005056924926" || _org == 'eaee75a4-ff2e-11ef-b508-005056924926' || _org == 'e775a5d7-039a-11f0-b508-005056924926' || _org == '4d3812ef-fa66-11ef-b508-005056924926') {
         _teacherDesktopIconInfo.push(
             // { "Name": "chatPDF", "Url": "chatPDF", "style": { "cssText": "background-image:url(/img/icon/chatPDF.png)" } },
             { "Name": "学习分析", "Url": "learnAna", "style": { "cssText": "background-image:url(/img/icon/learnAna.png)" } },
@@ -5070,6 +5071,8 @@ window.addEventListener('message', function (e) { // 监听 message 事件
         U.MD.D.I.openApplication("project")
     } else if (e.data.tools && e.data.tools == "71") {
         U.MD.D.I.openApplication("aigptCourse")
+    } else if (e.data.tools && e.data.tools == "72") {
+        U.MD.D.I.openInApplication("gptConfig", e.data.data)
     } else if (e.data.tools && e.data.tools == "1s") {
         U.MD.D.I.openApplicationJieS("whiteboard", e.data.cid, e.data.stage, e.data.task, e.data.tool)
     } else if (e.data.tools && e.data.tools == "3s") {
@@ -5607,6 +5610,17 @@ U.MD.D.I.openInApplication = function (str, data, screenType, tType) {
                     }, { "style": { "height": "36px" } }).form; //创建窗体
                     break;
                 }
+        case "gptConfig":
+            _formdiv = new U.UF.UI.form(
+                data.name ? data.name : "应用中心",
+                $$("iframe", { "allow": "camera *; microphone *;display-capture;midi;encrypted-media;", "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": data.url }), {
+                "id": "gptConfig" + data.id,
+                "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
+                "onresize": function () { }
+            }, {
+                closecallback: function () { }
+            }, { "style": { "height": "36px" } }).form; //创建窗体
+            break;
     }
 }
 U.MD.D.I.openApplication = function (str, obj, info) {

+ 29 - 13
js/Desktop/Onload.js

@@ -330,9 +330,9 @@ U.MD.D.getuser = function () {
                             if ($("#U_MD_HomeC_Pop")[0]) {
                                 $("#U_MD_HomeC_Pop")[0].close(); //关闭登陆
                             }
-                            U.A.Request(US.Config.pbl + "selectUser?userid=" + _user.userid, [], function (res) { //US.userInfo.userid
-                                loginSet(res.value[0][0], res)
-                            }, [], { "type": "GET", "withCredentials": true });
+                            selectUser(_user.userid, (res) => {
+                              loginSet(res.value[0][0], res);
+                            });
                         }
 
                     }, [], { "type": "GET", "withCredentials": true });
@@ -392,9 +392,9 @@ U.MD.D.getuser = function () {
                             if(a.length>0){
                                 let userId = a[0][0].userid
                                 US.userInfo.userid = userId
-                                U.A.Request(US.Config.pbl + "selectUser?userid=" + userId, [], function (res) { //US.userInfo.userid
-                                    loginSet(res.value[0][0], res)
-                                }, [], { "type": "GET", "withCredentials": true });
+                                selectUser(userId, (res) => {
+                                    loginSet(res.value[0][0], res);
+                                });
                             }
                             
                         })
@@ -456,9 +456,9 @@ U.MD.D.getuser = function () {
                             if(a.length>0){
                                 let userId = a[0][0].userid
                                 US.userInfo.userid = userId
-                                U.A.Request(US.Config.pbl + "selectUser?userid=" + userId, [], function (res) { //US.userInfo.userid
-                                    loginSet(res.value[0][0], res)
-                                }, [], { "type": "GET", "withCredentials": true });
+                                selectUser(userId, (res) => {
+                                    loginSet(res.value[0][0], res);
+                                });
                             }
                             
                         })
@@ -524,10 +524,10 @@ U.MD.D.getuser = function () {
                             if(a.length>0){
                                 let userId = a[0][0].userid
                                 US.userInfo.userid = userId
-                                U.A.Request(US.Config.pbl + "selectUser?userid=" + userId, [], function (res) { //US.userInfo.userid
+                                selectUser(userId, (res) => {
                                     loginSet(res.value[0][0], res)
                                     U.UF.DL.uploading(document.body)
-                                }, [], { "type": "GET", "withCredentials": true });
+                                });
                             }
                             
                         })
@@ -683,7 +683,7 @@ U.MD.D.getuser2 = function (userid, cid) {
                 }
                 let userId = a[0][0].userid
                 US.userInfo.userid = userId
-                U.A.Request(US.Config.pbl + "selectUser?userid=" + userid, [], function (res) { //US.userInfo.userid
+                selectUser(userId, (res) => {
                     if ($("#U_MD_HomeC_Pop")[0]) {
                         $("#U_MD_HomeC_Pop")[0].close(); //关闭登陆
                     }
@@ -718,7 +718,7 @@ U.MD.D.getuser2 = function (userid, cid) {
                     U.MD.O.P.connect(); //登录成功后连接socket服务同步协同编辑
                     U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
                     U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
-                }, [], { "type": "GET", "withCredentials": true });
+                });
             }
             
         })
@@ -1156,4 +1156,20 @@ function loginSet(userInfo, res){
         U.MD.D.I.openApplication(U.UF.C.queryString('app'))
     }
     U.MD.O.P.connect(); //登录成功后连接socket服务同步协同编辑
+}
+
+
+function selectUser(uid, callback) {
+    const requestUser = () => {
+        U.A.Request(US.Config.pbl + "selectUser?userid=" + uid, [], function (res) {
+            if (callback) callback(res);
+        }, [], { "type": "GET", "withCredentials": true });
+    };
+
+    try {
+        requestUser();
+    } catch (error) {
+        U.alert("登录失败,正在重试!")
+        requestUser();
+    }
 }