sunlightcs 8 years ago
parent
commit
7c4ccebb3d
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/main/resources/static/js/common.js
  2. 1 1
      src/main/resources/static/js/index.js

+ 2 - 2
src/main/resources/static/js/common.js

@@ -25,7 +25,7 @@ var baseURL = "/";
 //登录token
 var token = localStorage.getItem("token");
 if(token == 'null'){
-    parent.location.href = 'login.html';
+    parent.location.href = baseURL + 'login.html';
 }
 
 //jquery全局配置
@@ -38,7 +38,7 @@ $.ajaxSetup({
     complete: function(xhr) {
         //token过期,则跳转到登录页面
         if(xhr.responseJSON.code == 401){
-            parent.location.href = 'login.html';
+            parent.location.href = baseURL + 'login.html';
         }
     }
 });

+ 1 - 1
src/main/resources/static/js/index.js

@@ -85,7 +85,7 @@ var vm = new Vue({
 			//删除本地token
             localStorage.removeItem("token");
             //跳转到登录页面
-            location.href = 'login.html';
+            location.href = baseURL + 'login.html';
         },
         donate: function () {
             layer.open({