|
|
@@ -5,6 +5,7 @@ import javax.servlet.ServletResponse;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.shiro.web.filter.AccessControlFilter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
@@ -35,10 +36,10 @@ public class LoginFilter extends AccessControlFilter {
|
|
|
uri = "";
|
|
|
}
|
|
|
String basePath = httpRequest.getContextPath();// 获取basePath
|
|
|
- if (uri.startsWith(basePath)) {
|
|
|
+ if (StringUtils.isNotBlank(basePath) && uri.startsWith(basePath)) {
|
|
|
uri = uri.replaceAll("^\\" + basePath + "\\/+", "").replaceAll("\\.html$", "");
|
|
|
} else {
|
|
|
- uri = uri.replaceAll("^\\", "");
|
|
|
+ uri = uri.replaceAll("^\\/", "");
|
|
|
}
|
|
|
|
|
|
if (token != null && uri.startsWith("api/admin/") && token instanceof Admin) {
|