|
@@ -332,8 +332,8 @@ U.MD.D.error = function (errorMessage, scripturi, linenumber, columnnumber, erro
|
|
|
let LoginState = false
|
|
let LoginState = false
|
|
|
let CookieS = ''
|
|
let CookieS = ''
|
|
|
let CookieCheckTimes = 0
|
|
let CookieCheckTimes = 0
|
|
|
-let loginTimes = 0
|
|
|
|
|
let isPanL = false
|
|
let isPanL = false
|
|
|
|
|
+let _loginInFlight = false
|
|
|
U.MD.D.getuser = function () {
|
|
U.MD.D.getuser = function () {
|
|
|
// $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gif/longhuaBg.gif")'
|
|
// $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/gif/longhuaBg.gif")'
|
|
|
var userInfo = US.userInfo;
|
|
var userInfo = US.userInfo;
|
|
@@ -343,9 +343,10 @@ U.MD.D.getuser = function () {
|
|
|
LoginState = true
|
|
LoginState = true
|
|
|
var _cookie = U.UF.Cookie.get("cocorobo");
|
|
var _cookie = U.UF.Cookie.get("cocorobo");
|
|
|
try {
|
|
try {
|
|
|
- if (!panId && _cookie && loginType != 1) {
|
|
|
|
|
|
|
+ if (!panId && _cookie && loginType != 1 && !_loginInFlight) {
|
|
|
|
|
+ _loginInFlight = true;
|
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
|
- loginTimes++
|
|
|
|
|
|
|
+ _loginInFlight = false;
|
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
|
var _user = res.value[0][0];
|
|
var _user = res.value[0][0];
|
|
|
U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
|
|
U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
|
|
@@ -400,7 +401,6 @@ U.MD.D.getuser = function () {
|
|
|
fetch(url, requestOptions)
|
|
fetch(url, requestOptions)
|
|
|
.then(response => response.text())
|
|
.then(response => response.text())
|
|
|
.then(result => {
|
|
.then(result => {
|
|
|
- loginTimes++
|
|
|
|
|
// console.log(result)
|
|
// console.log(result)
|
|
|
let data = JSON.parse(result).data
|
|
let data = JSON.parse(result).data
|
|
|
if(JSON.parse(result).code == 200){
|
|
if(JSON.parse(result).code == 200){
|
|
@@ -464,7 +464,6 @@ U.MD.D.getuser = function () {
|
|
|
fetch(url, requestOptions)
|
|
fetch(url, requestOptions)
|
|
|
.then(response => response.text())
|
|
.then(response => response.text())
|
|
|
.then(result => {
|
|
.then(result => {
|
|
|
- loginTimes++
|
|
|
|
|
// console.log(result)
|
|
// console.log(result)
|
|
|
let data = JSON.parse(result).data
|
|
let data = JSON.parse(result).data
|
|
|
// return
|
|
// return
|
|
@@ -535,7 +534,6 @@ U.MD.D.getuser = function () {
|
|
|
fetch(url, requestOptions)
|
|
fetch(url, requestOptions)
|
|
|
.then(response => response.text())
|
|
.then(response => response.text())
|
|
|
.then(result => {
|
|
.then(result => {
|
|
|
- loginTimes++
|
|
|
|
|
// console.log(result)
|
|
// console.log(result)
|
|
|
let data = JSON.parse(result).data
|
|
let data = JSON.parse(result).data
|
|
|
// return
|
|
// return
|
|
@@ -696,18 +694,17 @@ U.MD.D.getuser = function () {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var _cookie = U.UF.Cookie.get("cocorobo");
|
|
var _cookie = U.UF.Cookie.get("cocorobo");
|
|
|
- if(LoginState && !_cookie && loginTimes != 0){
|
|
|
|
|
|
|
+ if(LoginState && !_cookie){
|
|
|
window.onbeforeunload = null
|
|
window.onbeforeunload = null
|
|
|
window.location.reload();
|
|
window.location.reload();
|
|
|
- }else if(LoginState && !CookieS && loginTimes != 0){
|
|
|
|
|
|
|
+ }else if(LoginState && !CookieS){
|
|
|
CookieS = _cookie
|
|
CookieS = _cookie
|
|
|
U.UF.Cookie.set("cocoroboLoginType=2");
|
|
U.UF.Cookie.set("cocoroboLoginType=2");
|
|
|
- }else if(LoginState && _cookie != CookieS && loginTimes != 0){
|
|
|
|
|
- U.alert(LoginState && _cookie != CookieS)
|
|
|
|
|
- window.alert(_cookie+""+CookieS)
|
|
|
|
|
- window.alert(LoginState)
|
|
|
|
|
|
|
+ }else if(LoginState && _cookie != CookieS && !_loginInFlight){
|
|
|
US.userInfo = {}
|
|
US.userInfo = {}
|
|
|
|
|
+ _loginInFlight = true;
|
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
|
|
|
+ _loginInFlight = false;
|
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
|
var _user = res.value[0][0];
|
|
var _user = res.value[0][0];
|
|
|
U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
|
|
U.A.Request(US.Config.edu + "admin/userinfo/userinfoById/" + _user.userid, [], function (res) {
|
|
@@ -726,18 +723,18 @@ U.MD.D.getuser = function () {
|
|
|
}, [], { "type": "GET", "withCredentials": true });
|
|
}, [], { "type": "GET", "withCredentials": true });
|
|
|
}else {
|
|
}else {
|
|
|
window.onbeforeunload = null
|
|
window.onbeforeunload = null
|
|
|
- widow.alert(_cookie+""+CookieS)
|
|
|
|
|
if(LoginState){
|
|
if(LoginState){
|
|
|
- U.alert(LoginState)
|
|
|
|
|
window.location.reload();
|
|
window.location.reload();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}, [], { "type": "GET", "withCredentials": true });
|
|
}, [], { "type": "GET", "withCredentials": true });
|
|
|
- }else if(LoginState && _cookie && !isPanL && loginTimes != 0){
|
|
|
|
|
|
|
+ }else if(LoginState && _cookie && !isPanL && !_loginInFlight){
|
|
|
CookieCheckTimes++
|
|
CookieCheckTimes++
|
|
|
if (CookieCheckTimes % 5 !== 0) return;
|
|
if (CookieCheckTimes % 5 !== 0) return;
|
|
|
isPanL = true
|
|
isPanL = true
|
|
|
|
|
+ _loginInFlight = true;
|
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
U.A.Request(US.Config.server + "getcookieuserid", [], function (res) {
|
|
|
|
|
+ _loginInFlight = false;
|
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
if (res.value && res.value[0] && res.value[0][0]) {
|
|
|
isPanL = false
|
|
isPanL = false
|
|
|
}else if(res.status && res.status.status != 0){
|
|
}else if(res.status && res.status.status != 0){
|