|
@@ -342,7 +342,17 @@ U.MD.D.getuser = function () {
|
|
|
window.location.reload();
|
|
|
}, [], { "type": "POST", "withCredentials": true });
|
|
|
} else {
|
|
|
- if(res.value[0][0].isLogin1 == 2 || res.value[0][0].isLogin2 == 2){
|
|
|
+ const currentDate = new Date();
|
|
|
+
|
|
|
+ // 辅助函数:判断是否是有效的日期
|
|
|
+ function isValidDate(dateValue) {
|
|
|
+ const date = new Date(dateValue);
|
|
|
+ return !isNaN(date.getTime()); // 如果 date.getTime() 返回 NaN,表示无效日期
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断 isLogin1 和 isLogin2 是否为 2 或者是否过期(且过期时间是有效的日期格式)
|
|
|
+ if ((res.value[0][0].isLogin1 == 2 || (isValidDate(res.value[0][0].isLogin1) && new Date(res.value[0][0].isLogin1) > currentDate)) ||
|
|
|
+ (res.value[0][0].isLogin2 == 2 || (isValidDate(res.value[0][0].isLogin2) && new Date(res.value[0][0].isLogin2) > currentDate))) {
|
|
|
U.MD.U.LO.logoutSystem2();
|
|
|
return;
|
|
|
}
|
|
@@ -561,7 +571,17 @@ U.MD.D.getuser = function () {
|
|
|
window.location.reload();
|
|
|
}, [], { "type": "POST", "withCredentials": true });
|
|
|
} else {
|
|
|
- if(res.value[0][0].isLogin1 == 2 || res.value[0][0].isLogin2 == 2){
|
|
|
+ const currentDate = new Date();
|
|
|
+
|
|
|
+ // 辅助函数:判断是否是有效的日期
|
|
|
+ function isValidDate(dateValue) {
|
|
|
+ const date = new Date(dateValue);
|
|
|
+ return !isNaN(date.getTime()); // 如果 date.getTime() 返回 NaN,表示无效日期
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断 isLogin1 和 isLogin2 是否为 2 或者是否过期(且过期时间是有效的日期格式)
|
|
|
+ if ((res.value[0][0].isLogin1 == 2 || (isValidDate(res.value[0][0].isLogin1) && new Date(res.value[0][0].isLogin1) > currentDate)) ||
|
|
|
+ (res.value[0][0].isLogin2 == 2 || (isValidDate(res.value[0][0].isLogin2) && new Date(res.value[0][0].isLogin2) > currentDate))) {
|
|
|
U.MD.U.LO.logoutSystem2();
|
|
|
return;
|
|
|
}
|
|
@@ -845,7 +865,17 @@ U.MD.D.getuser2 = function (userid, cid) {
|
|
|
if ($("#U_MD_HomeC_Pop")[0]) {
|
|
|
$("#U_MD_HomeC_Pop")[0].close(); //关闭登陆
|
|
|
}
|
|
|
- if(res.value[0][0].isLogin1 == 2 || res.value[0][0].isLogin2 == 2){
|
|
|
+ const currentDate = new Date();
|
|
|
+
|
|
|
+ // 辅助函数:判断是否是有效的日期
|
|
|
+ function isValidDate(dateValue) {
|
|
|
+ const date = new Date(dateValue);
|
|
|
+ return !isNaN(date.getTime()); // 如果 date.getTime() 返回 NaN,表示无效日期
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断 isLogin1 和 isLogin2 是否为 2 或者是否过期(且过期时间是有效的日期格式)
|
|
|
+ if ((res.value[0][0].isLogin1 == 2 || (isValidDate(res.value[0][0].isLogin1) && new Date(res.value[0][0].isLogin1) > currentDate)) ||
|
|
|
+ (res.value[0][0].isLogin2 == 2 || (isValidDate(res.value[0][0].isLogin2) && new Date(res.value[0][0].isLogin2) > currentDate))) {
|
|
|
U.MD.U.LO.logoutSystem2();
|
|
|
return;
|
|
|
}
|