完成租户部门与用户管理
parent
315c045c2b
commit
b91eb2ffdc
|
@ -12,13 +12,13 @@ public class WebMvcSaaSConfig implements WebMvcConfigurer {
|
||||||
/**
|
/**
|
||||||
* 不需要拦截的地址
|
* 不需要拦截的地址
|
||||||
*/
|
*/
|
||||||
public static final String[] excludeUrls = {"/login", "/logout", "/refresh"};
|
public static final String[] EXCLUDE_URLS = {"/dept/**", "/login", "/logout", "/refresh"};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInterceptors (InterceptorRegistry registry) {
|
public void addInterceptors (InterceptorRegistry registry) {
|
||||||
registry.addInterceptor(getHeaderInterceptor())
|
registry.addInterceptor(getHeaderInterceptor())
|
||||||
.addPathPatterns("/**")
|
.addPathPatterns("/**")
|
||||||
.excludePathPatterns(excludeUrls)
|
.excludePathPatterns(EXCLUDE_URLS)
|
||||||
.order(-10);
|
.order(-10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,8 @@ public class SysDeptController extends BaseController {
|
||||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
dept.setCreateBy(SecurityUtils.getUsername());
|
dept.setCreateBy(SecurityUtils.getUsername());
|
||||||
dept.setFirmCode(SecurityUtils.getSaasKey());
|
SysDept sysDept = deptService.selectDeptById(dept.getParentId());
|
||||||
|
dept.setFirmCode(sysDept.getFirmCode());
|
||||||
return toAjax(deptService.insertDept(dept));
|
return toAjax(deptService.insertDept(dept));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class SysUserController extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<SysUser>> list (SysUser user) {
|
public Result<TableDataInfo<SysUser>> list (SysUser user) {
|
||||||
startPage();
|
startPage();
|
||||||
|
user.setFirmCode(SecurityUtils.getSaasKey());
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
@ -197,6 +198,7 @@ public class SysUserController extends BaseController {
|
||||||
}
|
}
|
||||||
user.setCreateBy(SecurityUtils.getUsername());
|
user.setCreateBy(SecurityUtils.getUsername());
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
|
user.setFirmCode(SecurityUtils.getSaasKey());
|
||||||
return toAjax(userService.insertUser(user));
|
return toAjax(userService.insertUser(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,9 @@
|
||||||
<if test="userId != null and userId != 0">
|
<if test="userId != null and userId != 0">
|
||||||
AND u.user_id = #{userId}
|
AND u.user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="firmCode != null and firmCode != '' and firmCode != 'FIRM'">
|
||||||
|
AND u.firm_code like concat('%', #{firmCode}, '%')
|
||||||
|
</if>
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND u.user_name like concat('%', #{userName}, '%')
|
AND u.user_name like concat('%', #{userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
Loading…
Reference in New Issue