fix(web): fix token.js

This commit is contained in:
Masahiko AMANO 2023-01-27 17:00:35 +03:00
parent 46e67488f1
commit 7c58f011ca

View File

@ -2,6 +2,7 @@ $(window).on("load", function () {
let authorized = true; let authorized = true;
if ($.cookie("token") == null) { if ($.cookie("token") == null) {
authorized = false; authorized = false;
} else {
$.ajax({ $.ajax({
url: "/token", url: "/token",
type: "POST", type: "POST",
@ -9,9 +10,7 @@ $(window).on("load", function () {
data: `{"token":"${$.cookie("token")}"}`, data: `{"token":"${$.cookie("token")}"}`,
dataType: "json", dataType: "json",
success: function (resp) { success: function (resp) {
if (resp.status) { authorized = resp.status;
authorized = true;
}
}, },
failure: function (err) { failure: function (err) {
alert(err); alert(err);