mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
fix session maxAge #1625
This commit is contained in:
@@ -34,13 +34,13 @@ function getLang() {
|
||||
lang = window.navigator.language || window.navigator.userLanguage;
|
||||
|
||||
if (isSupportLang(lang)) {
|
||||
setCookie('lang', lang, 150);
|
||||
setCookie('lang', lang);
|
||||
} else {
|
||||
setCookie('lang', 'en-US', 150);
|
||||
setCookie('lang', 'en-US');
|
||||
window.location.reload();
|
||||
}
|
||||
} else {
|
||||
setCookie('lang', 'en-US', 150);
|
||||
setCookie('lang', 'en-US');
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ function setLang(lang) {
|
||||
lang = 'en-US';
|
||||
}
|
||||
|
||||
setCookie('lang', lang, 150);
|
||||
setCookie('lang', lang);
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,10 +95,13 @@ function getCookie(cname) {
|
||||
}
|
||||
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
const d = new Date();
|
||||
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
|
||||
let expires = "expires=" + d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||
let expires = "";
|
||||
if (exdays > 0) {
|
||||
const d = new Date();
|
||||
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
|
||||
expires = "expires=" + d.toUTCString();
|
||||
}
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=" + axios.defaults.baseURL;
|
||||
}
|
||||
|
||||
function usageColor(data, threshold, total) {
|
||||
|
||||
Reference in New Issue
Block a user