Bläddra i källkod

handle 401 error for ajax request

Avetisyan Karen 5 år sedan
förälder
incheckning
c9404d751a

BIN
web_interface/dist/wui-7/role.js


BIN
web_interface/dist/wui-9/role.js


+ 3 - 0
web_interface/src/wui-7/role.js

@@ -158,6 +158,9 @@ function loadXMLDoc(url, method, callback, body) {
         if (typeof callback == 'function') {
           callback.apply(xmlhttp);
         }
+      } else if (status == 401) {
+        alert('Request failed with status code 401');
+        window.location.reload();
       } else {
         console.log('Error');
       }

+ 3 - 0
web_interface/src/wui-9/role.js

@@ -158,6 +158,9 @@ function loadXMLDoc(url, method, callback, body) {
         if (typeof callback == 'function') {
           callback.apply(xmlhttp);
         }
+      } else if (status == 401) {
+        alert('Request failed with status code 401');
+        window.location.reload();
       } else {
         console.log('Error');
       }