瀏覽代碼

Merge branch 'beta'

lsc 5 月之前
父節點
當前提交
08cf69d2f6
共有 4 個文件被更改,包括 100 次插入36 次删除
  1. 25 1
      css/Desktop/Desktop.css
  2. 3 0
      index.html
  3. 11 0
      js/Desktop/DeskTop.js
  4. 61 35
      js/Desktop/Onload.js

+ 25 - 1
css/Desktop/Desktop.css

@@ -1172,4 +1172,28 @@ body div ::-webkit-scrollbar-resizer:vertical {
     white-space: nowrap;
     text-overflow: ellipsis;
     width: 100%;
-}
+}
+
+
+.U_PBL_Check2{
+    position: fixed;
+    bottom: calc(15% - 55px);
+    right: 5%;
+}
+
+.U_PBL_Check2>div{
+    background: #595959;
+    height: 45px;
+    width: 110px;
+    font-size: 14px;
+    border-radius: 5px;
+    cursor: pointer;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.U_PBL_Check2>div>span{
+    color: #fff;
+}
+

+ 3 - 0
index.html

@@ -160,6 +160,9 @@
                     </div>
                 </div>
             </div>
+            <div class="U_PBL_Check2">
+                <div class="active" onclick="U.MD.D.I.openApplication('userExamine')"><span>申请使用</span></div>
+            </div>
             <div class="U_PBL_Check">
                 <div class="active" onclick="U.MD.D.I.ModeCheck(1)"><span>标准模式</span></div>
                 <div onclick="U.MD.D.I.ModeCheck(2)"><span>极简模式</span></div>

+ 11 - 0
js/Desktop/DeskTop.js

@@ -7215,6 +7215,17 @@ U.MD.D.I.openApplication = function (str, obj, info) {
                 }, { "style": { "height": "36px" } }).form; //创建窗体
                 _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/appStore.png)" }, "name": "CocoFlow", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
                 break;
+        case "userExamine":
+                _formdiv = new U.UF.UI.form(
+                    "账号申请",
+                    $$("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": "//user.cocorobo.cn/#/examineDialog" }), {
+                    "id": "userExamine",
+                    "style": { "width": "490px", "height": "660px", "overflow": 'hidden' },
+                    "onresize": function () { }
+                }, {
+                    closecallback: function () { }
+                }, { "style": { "height": "36px" } }).form; //创建窗体
+                break;
     }
     
 

+ 61 - 35
js/Desktop/Onload.js

@@ -652,42 +652,68 @@ U.MD.D.addLoginTime = function(){
 }
 
 U.MD.D.getuser2 = function (userid, cid) {
-    U.A.Request(US.Config.pbl + "selectUser?userid=" + userid, [], function (res) { //US.userInfo.userid
-        if ($("#U_MD_HomeC_Pop")[0]) {
-            $("#U_MD_HomeC_Pop")[0].close(); //关闭登陆
-        }
-        loginPan(res.value[0][0], userid)
+    let loginData = JSON.stringify({
+        openid: userid,
+        edu: true
+    })
+    var requestOptionsLogin = {
+        method: 'POST',
+        headers: myHeaders,
+        body: loginData,
+        redirect: 'follow'
+     };
+     
+     fetch("https://beta.api.cocorobo.cn/api/user", requestOptionsLogin)
+        .then(response => response.text())
+        .then(result => {
+            let a = JSON.parse(result)
+            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
+                    if ($("#U_MD_HomeC_Pop")[0]) {
+                        $("#U_MD_HomeC_Pop")[0].close(); //关闭登陆
+                    }
+                    loginPan(res.value[0][0], userid)
+            
+                    US.userInfo = res.value[0][0];
+                    $(".avatar")[0].style.display = "block";
+                    if (res.value[0][0].type === 1 && $(".U_PBL_Check")[0] && res.value[0][0].org != '150e3120-9195-11ed-b13d-005056b86db5') {
+                        $(".U_PBL_Check")[0].style.display = "block";
+                    }
+                    $(".login")[0].style.display = "none";
+                    $(".register")[0].style.display = "none";
+                    $(".userName")[0].style.display = "block";
+                    $(".userName")[0].innerHTML = US.userInfo.username || US.userInfo.alias;
+                    $(".exit")[0].style.display = "block";
+                    let _vipbox = $('.U_MD_D_BD_vip_box')[0]
+                    _vipbox && (_vipbox.style.right = $(".U_MD_D_BD")[0].offsetWidth + 20 + 'px')
+                    if(res.value[0][0].type === 1 && res.value[0][0].org == 'c95e0a56-c205-11ed-8d51-005056b86db5'){
+                        U.MD.D.I.ModeCheck(2)
+                    }else{
+                        U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0], 1);
+                    }
+                    if(res.value[0][0].type === 1 && window.location.hash.indexOf('project') != -1){
+                        U.MD.D.I.openApplication("project")
+                    }
+                    if(res.value[0][0].type === 1 && window.location.hash.indexOf('study') != -1){
+                        U.MD.D.I.openApplication("study")
+                    }
+                    if(res.value[0][0].type === 2 && window.location.hash.indexOf('study') != -1){
+                        U.MD.D.I.openApplication("studentStudy")
+                    }
+                    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 });
+            }
+            
+        })
+        .catch(error => {
+            LoginState = false
+            console.log('error', error)
+        });
 
-        US.userInfo = res.value[0][0];
-        $(".avatar")[0].style.display = "block";
-        if (res.value[0][0].type === 1 && $(".U_PBL_Check")[0] && res.value[0][0].org != '150e3120-9195-11ed-b13d-005056b86db5') {
-            $(".U_PBL_Check")[0].style.display = "block";
-        }
-        $(".login")[0].style.display = "none";
-        $(".register")[0].style.display = "none";
-        $(".userName")[0].style.display = "block";
-        $(".userName")[0].innerHTML = US.userInfo.username || US.userInfo.alias;
-        $(".exit")[0].style.display = "block";
-        let _vipbox = $('.U_MD_D_BD_vip_box')[0]
-        _vipbox && (_vipbox.style.right = $(".U_MD_D_BD")[0].offsetWidth + 20 + 'px')
-        if(res.value[0][0].type === 1 && res.value[0][0].org == 'c95e0a56-c205-11ed-8d51-005056b86db5'){
-            U.MD.D.I.ModeCheck(2)
-        }else{
-            U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0], 1);
-        }
-        if(res.value[0][0].type === 1 && window.location.hash.indexOf('project') != -1){
-            U.MD.D.I.openApplication("project")
-        }
-        if(res.value[0][0].type === 1 && window.location.hash.indexOf('study') != -1){
-            U.MD.D.I.openApplication("study")
-        }
-        if(res.value[0][0].type === 2 && window.location.hash.indexOf('study') != -1){
-            U.MD.D.I.openApplication("studentStudy")
-        }
-        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 });
 }