master
yuanjunzhe 2024-04-12 19:53:31 +08:00
parent 813f5bdef8
commit 3c0f032769
7 changed files with 53 additions and 0 deletions

View File

@ -46,6 +46,8 @@ public class SysLoginService {
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
throw new ServiceException("用户/密码必须填写");
}
// 密码如果不在指定范围内 错误
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {

View File

@ -41,4 +41,5 @@ public class SysRecordLogService {
}
remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER);
}
}

View File

@ -37,6 +37,13 @@ public class SysLogininfor extends BaseEntity {
@Excel(name = "用户账号")
private String userName;
/**
*
*/
@Excel(name = "用户账号")
private String email;
/**
* 0 1
*/

View File

@ -21,6 +21,9 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
*/
public List<SysMenu> selectMenuList (SysMenu menu);
public List<SysMenu> selectSyeMenuList(@Param("longs") List<Long> longs);
/**
*
*

View File

@ -51,6 +51,27 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
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)) {
menuList = menuMapper.selectMenuList(menu);
menuList.addAll(selectSysMenuList(menuList));
} else {
menu.getParams().put("userId", userId);
menuList = menuMapper.selectMenuListByUserId(menu);
}
menuList.stream()
.distinct()
.toList();
return menuList;
}

View File

@ -301,6 +301,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
*/
@Override
public int updateUserStatus (SysUser user) {
return userMapper.updateUser(user);
}

View File

@ -185,6 +185,20 @@
<include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
</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 sys_menu