fix(web): fix token.js
This commit is contained in:
parent
46e67488f1
commit
7c58f011ca
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user