瀏覽代碼

handle 401 error for ajax request

Avetisyan Karen 5 年之前
父節點
當前提交
c9404d751a
共有 4 個文件被更改,包括 6 次插入0 次删除
  1. 二進制
      web_interface/dist/wui-7/role.js
  2. 二進制
      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

二進制
web_interface/dist/wui-7/role.js


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