mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Redirect to login page when status request not authorized
This commit is contained in:
@@ -10,6 +10,8 @@ var numPorts = 0;
|
|||||||
function update() {
|
function update() {
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
|
if (this.readyState == 4 && this.status == 401)
|
||||||
|
document.location = "/login.html"
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
const s = JSON.parse(xhttp.responseText);
|
const s = JSON.parse(xhttp.responseText);
|
||||||
if (!numPorts) {
|
if (!numPorts) {
|
||||||
|
|||||||
Reference in New Issue
Block a user