Commit 2659e062 authored by 李永强's avatar 李永强

Merge remote-tracking branch 'origin/developer' into developer

parents 9f8b4dbc 48b5f522
Pipeline #217 canceled with stages
......@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
@Component
public class LoginIntercept implements HandlerInterceptor {
......@@ -102,9 +103,10 @@ public class LoginIntercept implements HandlerInterceptor {
private boolean getJurisdictionByRoles(User user, String requestUrl) {
if (user == null)
return false;
Role role = user.getRole();
if (role == null)
List<Role> roleList = user.getRoleList();
if (roleList == null)
return false;
for (Role role : roleList) {
if (RoleTable.admin.getId().equals(role.getId()))
return true;
Role complexRole = jurisdictionService.findMenusByRoleId(role.getId());
......@@ -112,6 +114,7 @@ public class LoginIntercept implements HandlerInterceptor {
if (requestUrl.indexOf(menu.getUrl()) > 0)
return true;
}
}
return false;
}
......
......@@ -3,6 +3,8 @@ package com.restful.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
public class User extends BaseInfo {
private String userName;
......@@ -12,7 +14,7 @@ public class User extends BaseInfo {
@ApiModelProperty(hidden = true)
private Boolean resetPassword;
private String phone;
private Role role;
private List<Role> roleList;
public Boolean getResetPassword() {
return resetPassword;
......@@ -46,12 +48,12 @@ public class User extends BaseInfo {
this.name = name;
}
public Role getRole() {
return role;
public List<Role> getRoleList() {
return roleList;
}
public void setRole(Role role) {
this.role = role;
public void setRoleList(List<Role> roleList) {
this.roleList = roleList;
}
public void setPhone(String phone) {
......
......@@ -16,7 +16,7 @@
</resultMap>
<resultMap id="userMap_ex" type="com.restful.domain.User" extends="userMap">
<association property="role" resultMap="com.restful.dao.JurisdictionDao.simpleRoleMap"/>
<association property="roleList" resultMap="com.restful.dao.JurisdictionDao.simpleRoleMap"/>
</resultMap>
<insert id="addUser" useGeneratedKeys="true" keyProperty="id">
......@@ -45,7 +45,7 @@
from users
left join user_role on ur_user_id = user_id
left join role on role_id = ur_role_id
where role_id = '${@com.jianju.detecting.field.RoleTable@detection_admin.id}'
where 1=1
<if test="name!=null">
and user_name like '%'||#{name}||'%'
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment