查询1
parent
813f5bdef8
commit
3c0f032769
|
@ -46,6 +46,8 @@ public class SysLoginService {
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
|
||||||
throw new ServiceException("用户/密码必须填写");
|
throw new ServiceException("用户/密码必须填写");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 密码如果不在指定范围内 错误
|
// 密码如果不在指定范围内 错误
|
||||||
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||||
|
|
|
@ -41,4 +41,5 @@ public class SysRecordLogService {
|
||||||
}
|
}
|
||||||
remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER);
|
remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,13 @@ public class SysLogininfor extends BaseEntity {
|
||||||
@Excel(name = "用户账号")
|
@Excel(name = "用户账号")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户邮箱
|
||||||
|
*/
|
||||||
|
@Excel(name = "用户账号")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 0成功 1失败
|
* 状态 0成功 1失败
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,6 +21,9 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList (SysMenu menu);
|
public List<SysMenu> selectMenuList (SysMenu menu);
|
||||||
|
|
||||||
|
|
||||||
|
public List<SysMenu> selectSyeMenuList(@Param("longs") List<Long> longs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户所有权限
|
* 根据用户所有权限
|
||||||
*
|
*
|
||||||
|
|
|
@ -51,6 +51,27 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||||
return selectMenuList(new SysMenu(), userId);
|
return selectMenuList(new SysMenu(), userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<SysMenu> selectSysMenuList(List<SysMenu> menuList){
|
||||||
|
|
||||||
|
List<Long> longs = menuList.stream()
|
||||||
|
.map(menu -> menu.getParentId())
|
||||||
|
.filter(parentId -> parentId != 0)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
if (longs.size()==0){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<SysMenu> sysMenus = menuMapper.selectSyeMenuList(longs);
|
||||||
|
List<SysMenu> sysMenus1 = selectSysMenuList(sysMenus);
|
||||||
|
|
||||||
|
if (sysMenus1 !=null){
|
||||||
|
sysMenus.addAll(sysMenus1);
|
||||||
|
}
|
||||||
|
return sysMenus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统菜单列表
|
* 查询系统菜单列表
|
||||||
*
|
*
|
||||||
|
@ -64,10 +85,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||||
// 管理员显示所有菜单信息
|
// 管理员显示所有菜单信息
|
||||||
if (SysUser.isAdmin(userId)) {
|
if (SysUser.isAdmin(userId)) {
|
||||||
menuList = menuMapper.selectMenuList(menu);
|
menuList = menuMapper.selectMenuList(menu);
|
||||||
|
menuList.addAll(selectSysMenuList(menuList));
|
||||||
} else {
|
} else {
|
||||||
menu.getParams().put("userId", userId);
|
menu.getParams().put("userId", userId);
|
||||||
menuList = menuMapper.selectMenuListByUserId(menu);
|
menuList = menuMapper.selectMenuListByUserId(menu);
|
||||||
}
|
}
|
||||||
|
menuList.stream()
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,6 +301,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateUserStatus (SysUser user) {
|
public int updateUserStatus (SysUser user) {
|
||||||
|
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,20 @@
|
||||||
<include refid="selectMenuVo"/>
|
<include refid="selectMenuVo"/>
|
||||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectSyeMenuList" resultType="com.muyu.system.domain.SysMenu">
|
||||||
|
<include refid="selectMenuVo"/>
|
||||||
|
|
||||||
|
<where>
|
||||||
|
|
||||||
|
menu_id in (
|
||||||
|
<foreach collection="longs" separator="," item="id">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
|
||||||
|
</where>
|
||||||
|
order by parent_id,order_num
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateMenu" parameterType="com.muyu.system.domain.SysMenu">
|
<update id="updateMenu" parameterType="com.muyu.system.domain.SysMenu">
|
||||||
update sys_menu
|
update sys_menu
|
||||||
|
|
Loading…
Reference in New Issue