|
|
@@ -33,18 +33,18 @@ U.MD.D.LocalStorage = null;
|
|
|
*/
|
|
|
window.onload = function () {
|
|
|
U.MD.D.Load();
|
|
|
- // U.MD.U.L.login();
|
|
|
+ U.MD.U.L.login();
|
|
|
//U.MD.D.isLogin();
|
|
|
// U.MD.D.fullscreen();
|
|
|
U.MD.D.stopSafari();
|
|
|
|
|
|
- const params = ['type', 'courseid', 'orgnum', 'classcode', 'state', 'form'].reduce((acc, key) => {
|
|
|
+ const params = ['type', 'courseid', 'orgnum', 'classcode'].reduce((acc, key) => {
|
|
|
const value = U.UF.C.queryString(key);
|
|
|
if (value) acc[key] = value;
|
|
|
return acc;
|
|
|
}, {});
|
|
|
U.MD.D.I.openApplication('liyuanLogin', params);
|
|
|
-
|
|
|
+
|
|
|
let _hashSearch = "?" + (window.location.hash.split("?")[1] || "");
|
|
|
let shareCourseId = U.UF.C.queryString("shareCourseId", _hashSearch);
|
|
|
let _shareType = U.UF.C.queryString("type", _hashSearch);
|
|
|
@@ -61,19 +61,19 @@ window.onload = function () {
|
|
|
}
|
|
|
|
|
|
US.Config = {
|
|
|
- server: '//beta.api.cocorobo.cn/api/',
|
|
|
- api: '//beta.api.cocorobo.cn/',
|
|
|
+ server: '//cloud.api.cocorobo.hk/api/',
|
|
|
+ api: '//cloud.api.cocorobo.hk/',
|
|
|
chat: "//chat.api.cocorobo.cn/",
|
|
|
edu: '//api.edu.cocorobo.cn/edu/',
|
|
|
origin: '//cocorobo.cn',
|
|
|
pbl: "//pbl.cocorobo.cn/api/pbl/",
|
|
|
- // bpbl:"//pbl.cocorobo.cn",//正式链接
|
|
|
- bpbl:"//beta.pbl.cocorobo.cn",//测试链接
|
|
|
+ // bpbl:"//pbl.cocorobo.cn",//正式鏈接
|
|
|
+ // bpbl:"//beta.pbl.cocorobo.cn",//測試鏈接
|
|
|
+ bpbl:"//pbl.cocorobo.hk",//hk鏈接
|
|
|
// pbl: "http://localhost:7003/api/pbl/",
|
|
|
basename: '',
|
|
|
type:1,
|
|
|
- // background:'url("/img/icon/bgImg4.png")'
|
|
|
- background:''
|
|
|
+ background:'url("/img/icon/bgImg4.png")'
|
|
|
}
|
|
|
/**
|
|
|
* 供外部调用的window.onload函数云端系统启动项
|
|
|
@@ -346,7 +346,7 @@ U.MD.D.getuser = function () {
|
|
|
if (!panId && _cookie && loginType != 1 && !_loginInFlight) {
|
|
|
_loginInFlight = true;
|
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
|
- _loginInFlight = false;
|
|
|
+ _loginInFlight = false;
|
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
|
var _user = res.value[0][0];
|
|
|
U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
|
|
|
@@ -704,7 +704,7 @@ U.MD.D.getuser = function () {
|
|
|
US.userInfo = {}
|
|
|
_loginInFlight = true;
|
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
|
- _loginInFlight = false;
|
|
|
+ _loginInFlight = false;
|
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
|
var _user = res.value[0][0];
|
|
|
U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
|
|
|
@@ -723,9 +723,7 @@ U.MD.D.getuser = function () {
|
|
|
}, [], { "type": "GET", "withCredentials": true });
|
|
|
}else {
|
|
|
window.onbeforeunload = null
|
|
|
- if(LoginState){
|
|
|
- window.location.reload();
|
|
|
- }
|
|
|
+ window.location.reload();
|
|
|
}
|
|
|
}, [], { "type": "GET", "withCredentials": true });
|
|
|
}else if(LoginState && _cookie && !isPanL && !_loginInFlight){
|
|
|
@@ -734,7 +732,7 @@ U.MD.D.getuser = function () {
|
|
|
isPanL = true
|
|
|
_loginInFlight = true;
|
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
|
- _loginInFlight = false;
|
|
|
+ _loginInFlight = false;
|
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
|
isPanL = false
|
|
|
}else if(res.status && res.status.status != 0){
|
|
|
@@ -1032,8 +1030,8 @@ function loginPan(userInfo, userId) {
|
|
|
let vip_member = $(".vip_member")[0];
|
|
|
vip_member && (vip_member.innerHTML = vMember);
|
|
|
|
|
|
-// addOp('','cocoflowLogin','')
|
|
|
-// addOp('','cocoflowOpen','')
|
|
|
+ addOp('','cocoflowLogin','')
|
|
|
+ addOp('','cocoflowOpen','')
|
|
|
// U.A.Request(
|
|
|
// US.Config.pbl + "addLoginOperation",
|
|
|
// [userId],
|
|
|
@@ -1241,7 +1239,6 @@ function loginSet(userInfo, res){
|
|
|
// U.MD.D.I.openApplication("appStore")
|
|
|
// }
|
|
|
|
|
|
- // let shareCourseId = window.location.href.indexOf("?shareCourseId=")!=-1?window.location.href.split("?shareCourseId=")[1].toString():''
|
|
|
let _hashSearch = "?" + (window.location.hash.split("?")[1] || "");
|
|
|
let shareCourseId = U.UF.C.queryString("shareCourseId", _hashSearch);
|
|
|
let _shareType = U.UF.C.queryString("type", _hashSearch);
|
|
|
@@ -1281,16 +1278,11 @@ function selectUser(uid, callback) {
|
|
|
const requestUser = () => {
|
|
|
U.A.Request(`${US.Config.pbl}selectUser?userid=${uid}`, [], function (res) {
|
|
|
if(res && res.value && res.value.length && res.value[0].length && res.value[0][0].userid){
|
|
|
- if(U.UF.C.queryString('form') == 'desktop') {
|
|
|
- window.location.href=`cocorobo://auth/callback?apiKey=${res.value[0][0].apikey}&state=${U.UF.C.queryString('state')}&userid=${res.value[0][0].userid}&username=${res.value[0][0].username}&schoolname=${res.value[0][0].schoolName}`
|
|
|
- }
|
|
|
if (callback) callback(res);
|
|
|
}else {
|
|
|
U.alert("获取用户信息失败,正在重试!")
|
|
|
LoginState = false
|
|
|
- setTimeout(() => {
|
|
|
- requestUser();
|
|
|
- }, 10000);
|
|
|
+ requestUser();
|
|
|
}
|
|
|
}, [], { "type": "GET", "withCredentials": true });
|
|
|
};
|
|
|
@@ -1300,9 +1292,7 @@ function selectUser(uid, callback) {
|
|
|
} catch (error) {
|
|
|
U.alert("登录失败,正在重试!")
|
|
|
LoginState = false
|
|
|
- setTimeout(() => {
|
|
|
- requestUser();
|
|
|
- }, 10000);
|
|
|
+ requestUser();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1313,34 +1303,6 @@ function addOp(text,type,time){
|
|
|
}, [], { "type": "POST", "withCredentials": true });
|
|
|
}
|
|
|
}
|
|
|
-function detectBrowser() {
|
|
|
- const ua = navigator.userAgent;
|
|
|
-
|
|
|
- // 按优先级顺序检测
|
|
|
- if (ua.includes("Edg/") || ua.includes("Edge/")) {
|
|
|
- return "Microsoft Edge";
|
|
|
- } else if (ua.includes("Firefox")) {
|
|
|
- return "Mozilla Firefox";
|
|
|
- } else if (ua.includes("Trident") || ua.includes("MSIE")) {
|
|
|
- return "Internet Explorer";
|
|
|
- } else if (ua.includes("360EE")) {
|
|
|
- return "360 Browser (极速模式)";
|
|
|
- } else if (ua.includes("360SE")) {
|
|
|
- return "360 Browser (安全模式)";
|
|
|
- } else if (ua.includes("SLBrowser")) {
|
|
|
- return "QQ Browser";
|
|
|
- } else if (ua.includes("UCBrowser")) {
|
|
|
- return "UC Browser";
|
|
|
- } else if (ua.includes("Opera") || ua.includes("OPR/")) {
|
|
|
- return "Opera";
|
|
|
- } else if (ua.includes("Chrome") && !ua.includes("Edg/")) {
|
|
|
- return "Google Chrome";
|
|
|
- } else if (ua.includes("Safari/") && !ua.includes("Chrome")) {
|
|
|
- return "Safari";
|
|
|
- } else {
|
|
|
- return "Other Browser";
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
U.MD.D.addOp3 = async (userTime, loadTime, object, status) => {
|
|
|
let browser = detectBrowser()
|