فهرست منبع

handle 401 error for ajax request

Avetisyan Karen 5 سال پیش
والد
کامیت
c9404d751a
4فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. BIN
      web_interface/dist/wui-7/role.js
  2. BIN
      web_interface/dist/wui-9/role.js
  3. 3 0
      web_interface/src/wui-7/role.js
  4. 3 0
      web_interface/src/wui-9/role.js

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');
       }