This commit is contained in:
姚宇浩 2024-10-08 16:47:35 +08:00
parent 02b218d1a9
commit 4984046e8e
1 changed files with 6 additions and 13 deletions

View File

@ -196,27 +196,20 @@ const login = () => {
if (routers.query.token) { if (routers.query.token) {
const encryptedText = routers.query.token; const encryptedText = routers.query.token;
const decodedText = decrypt(encryptedText, ENCODED_KEY); const decodedText = decrypt(encryptedText, ENCODED_KEY);
console.log("Decrypted Text:", decodedText); // console.log("Decrypted Text:", decodedText);
var tokenU = decodedText; var tokenU = decodedText;
}
// var tokenU = CryptoJS.enc.Utf8.parse(routers.query.token);
// var token = getCookie("lytoken");
// tokenU = "6b0e380b4a8f46baae4923f83faf670d";
if (tokenU) {
document.cookie = `lytoken=${tokenU}`; document.cookie = `lytoken=${tokenU}`;
var token = getCookie("lytoken"); var token = getCookie("lytoken");
if (!token) {
window.location.href =
"http://220.191.238.50:996/api/login?returnURL=" +
window.location.href;
} else {
tools.data.set("token", token); tools.data.set("token", token);
tools.data.set("type", 2); tools.data.set("type", 2);
}
} else { } else {
var tokenPd = getCookie("lytoken");
if (!tokenPd) {
window.location.href = window.location.href =
"http://220.191.238.50:996/api/login?returnURL=" + "http://220.191.238.50:996/api/login?returnURL=" +
window.location.href; window.location.href;
} else {
}
} }
}); });
}; };