albertshaw лет назад: 8
Родитель
Сommit
e4d20232c1
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/main/java/com/goafanti/core/shiro/filter/LoginFilter.java

+ 4 - 2
src/main/java/com/goafanti/core/shiro/filter/LoginFilter.java

@@ -37,6 +37,8 @@ public class LoginFilter extends AccessControlFilter {
 		String basePath = httpRequest.getContextPath();// 获取basePath
 		if (uri.startsWith(basePath)) {
 			uri = uri.replaceAll("^\\" + basePath + "\\/+", "").replaceAll("\\.html$", "");
+		} else {
+			uri = uri.replaceAll("^\\", "");
 		}
 
 		if (token != null && uri.startsWith("api/admin/") && token instanceof Admin) {
@@ -46,11 +48,11 @@ public class LoginFilter extends AccessControlFilter {
 		if (token != null && uri.startsWith("techservice/") && token instanceof User) {
 			return Boolean.TRUE;
 		}
-		
+
 		if (token != null && uri.startsWith("api/techproject/") && token instanceof User) {
 			return Boolean.TRUE;
 		}
-		
+
 		if (token != null && uri.startsWith("api/user/") && token instanceof User) {
 			return Boolean.TRUE;
 		}