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