看到53集,修复了一些bug
This commit is contained in:
parent
c8db8de256
commit
676e307624
|
@ -37,6 +37,6 @@ public class FileUploadController {
|
||||||
uploadFileVo.setFilesize(file.getSize());
|
uploadFileVo.setFilesize(file.getSize());
|
||||||
uploadFileVo.setFilepath(fileUrl);
|
uploadFileVo.setFilepath(fileUrl);
|
||||||
|
|
||||||
return Result.build(uploadFileVo, ResultCodeEnum.SUCCESS);
|
return Result.build(fileUrl, ResultCodeEnum.SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package cn.bunny.mapper;
|
package cn.bunny.mapper;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -9,8 +10,8 @@ public interface SysRoleUserMapper {
|
||||||
// 根据userId删除用户之前分配角色数据
|
// 根据userId删除用户之前分配角色数据
|
||||||
void deleteByUserId(Long userId);
|
void deleteByUserId(Long userId);
|
||||||
|
|
||||||
// 重新分配新数据
|
// 重新分配新数据 @Param 导包不要导错
|
||||||
void doAssign(Long userId, Long roleId);
|
void doAssign(@Param("userId") Long userId,@Param("roleId") Long roleId);
|
||||||
|
|
||||||
// 根据userId查询用户分配过角色id列表
|
// 根据userId查询用户分配过角色id列表
|
||||||
List<Long> selectRoleByUserId(Long userId);
|
List<Long> selectRoleByUserId(Long userId);
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class SysRoleServiceImpl implements SysRoleService {
|
||||||
// 分配过的角色
|
// 分配过的角色
|
||||||
List<Long> roleIds = sysRoleUserMapper.selectRoleByUserId(userId);
|
List<Long> roleIds = sysRoleUserMapper.selectRoleByUserId(userId);
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("allRoleList", roleList);
|
map.put("allRolesList", roleList);
|
||||||
map.put("sysUserRoles", roleIds);
|
map.put("sysUserRoles", roleIds);
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
|
|
||||||
<!-- 根据userid查询可以操作菜单 -->
|
<!-- 根据userid查询可以操作菜单 -->
|
||||||
<select id="findMenuByUserId" resultMap="sysRoleMap">
|
<select id="findMenuByUserId" resultMap="sysRoleMap">
|
||||||
select *
|
select distinct m.*
|
||||||
from sys_menu m
|
from sys_menu m
|
||||||
inner join sys_role_menu srm on m.id = srm.menu_id
|
inner join sys_role_menu srm on m.id = srm.menu_id
|
||||||
inner join sys_user_role sur on srm.role_id = sur.role_id
|
inner join sys_user_role sur on srm.role_id = sur.role_id
|
||||||
|
|
|
@ -4,13 +4,14 @@
|
||||||
|
|
||||||
<!-- 保存分配数据 -->
|
<!-- 保存分配数据 -->
|
||||||
<insert id="doAssign">
|
<insert id="doAssign">
|
||||||
insert into sys_role_menu (role_id, menu_id, create_time, update_time, is_deleted, is_half)
|
insert into sys_role_menu (
|
||||||
values
|
role_id,
|
||||||
(
|
menu_id,
|
||||||
|
create_time , update_time , is_deleted , is_half
|
||||||
|
) values
|
||||||
<foreach collection="menuIdList" item="menuInfo" separator=",">
|
<foreach collection="menuIdList" item="menuInfo" separator=",">
|
||||||
#{roleId},#{menuInfo.id},now(),now(),0,#{menuInfo.isHalf}
|
(#{roleId} , #{menuInfo.id} , now() , now() , 0 , #{menuInfo.isHalf})
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 删除角色分配菜单数据 -->
|
<!-- 删除角色分配菜单数据 -->
|
||||||
|
@ -24,7 +25,7 @@
|
||||||
<select id="findSysRoleMenuByRoleId" resultType="java.lang.Long">
|
<select id="findSysRoleMenuByRoleId" resultType="java.lang.Long">
|
||||||
select menu_id
|
select menu_id
|
||||||
from sys_role_menu
|
from sys_role_menu
|
||||||
where menu_id = #{roleId}
|
where role_id = #{roleId}
|
||||||
and is_deleted = 0
|
and is_deleted = 0
|
||||||
and is_half = 0
|
and is_half = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
<if test="status !=null and status != ''">
|
<if test="status !=null and status != ''">
|
||||||
status=#{status},
|
status=#{status},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="avatar !=null and avatar != ''">
|
||||||
|
avatar=#{avatar},
|
||||||
|
</if>
|
||||||
update_time = now()
|
update_time = now()
|
||||||
where id=#{id}
|
where id=#{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
Loading…
Reference in New Issue