Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -313,7 +313,7 @@ public class SysUserService {
|
||||
List<SysRole> sysRoles = sysRoleService.listByUserIdEnable(userId, enable);
|
||||
if (CollectionUtils.isEmpty(sysRoles))
|
||||
return list;
|
||||
//遍获取每个角色拥有的权限,并去重
|
||||
//遍历获取每个角色拥有的权限,并去重
|
||||
List<SysAuthority> temp;
|
||||
for (SysRole sysRole : sysRoles) {
|
||||
temp = sysAuthorityService.listByRoleIdEnable(sysRole.getId(), enable);
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.xwbing.util.captcah;
|
||||
package com.xwbing.util.captcha;
|
||||
|
||||
/**
|
||||
* 说明:创建验证码异常类
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.xwbing.util.captcah;
|
||||
package com.xwbing.util.captcha;
|
||||
|
||||
import com.xwbing.constant.CommonConstant;
|
||||
import com.xwbing.util.CommonDataUtil;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.xwbing.util.captcah;
|
||||
package com.xwbing.util.captcha;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
@@ -56,11 +56,6 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!--热部署 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
</dependency>
|
||||
<!-- maven打war包需要 项目部署到外部tomcat -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -44,11 +44,11 @@ public class DispatcherServletConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
/**
|
||||
* 配置静态访问资源
|
||||
* 默认:
|
||||
* 默认:优先级
|
||||
* classpath:/META-INF/resources
|
||||
* classpath:/resources
|
||||
* classpath:/static
|
||||
* classpath:/public
|
||||
* classpath:/resources
|
||||
* classpath:/META-INF/resources
|
||||
*
|
||||
* @param registry
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.xwbing.configuration;
|
||||
|
||||
import com.xwbing.util.captcah.CaptchaServlet;
|
||||
import com.xwbing.util.captcha.CaptchaServlet;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
@@ -27,7 +27,7 @@ public class ServletConfig {
|
||||
logger.info("注册验证码servlet ======================= ");
|
||||
ServletRegistrationBean registration = new ServletRegistrationBean(captchaServlet);
|
||||
registration.setEnabled(true);
|
||||
registration.addUrlMappings("/servlet/captchaCode");
|
||||
registration.addUrlMappings("/servlet/captcha");
|
||||
return registration;
|
||||
}
|
||||
/********************************************/
|
||||
|
||||
@@ -27,7 +27,7 @@ public class LoginInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
static {
|
||||
//验证码
|
||||
set.add("/servlet/captchaCode");
|
||||
set.add("/servlet/captcha");
|
||||
//swagger
|
||||
set.add("/v2/api-docs");
|
||||
set.add("/swagger-resources");
|
||||
@@ -38,7 +38,6 @@ public class LoginInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
String servletPath = request.getServletPath();
|
||||
if (!set.contains(servletPath) && !servletPath.contains("login")) {
|
||||
// HttpSession session = request.getSession();
|
||||
@@ -56,6 +55,8 @@ public class LoginInterceptor extends HandlerInterceptorAdapter {
|
||||
restMessage.setMessage("请先登录");
|
||||
outputStream.write(JSON.toJSONString(restMessage).getBytes("utf-8"));
|
||||
outputStream.close();
|
||||
//未登录,重定向到登录页面
|
||||
// response.sendRedirect("/login.html");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
var basePath="http://127.0.0.1:8080/";
|
||||
Reference in New Issue
Block a user