mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 10:29:19 +08:00
完成媒体管理模块
This commit is contained in:
+2
-2
@@ -15,9 +15,9 @@ public class UpdateUserInfoDTO {
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 头像路径
|
||||
* 头像图片ID
|
||||
*/
|
||||
private String avatar;
|
||||
private Long avatarImageId;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
|
||||
+7
-1
@@ -63,11 +63,17 @@ public class UserPO {
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 头像路径
|
||||
* 头像路径(冗余字段)
|
||||
*/
|
||||
@TableField("avatar")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 头像图片ID
|
||||
*/
|
||||
@TableField("avatar_image_id")
|
||||
private Long avatarImageId;
|
||||
|
||||
/**
|
||||
* 关联角色(user-普通账户 admin-公司管理员账户 super-超管账户)
|
||||
*/
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
||||
}
|
||||
|
||||
// 获取岗位的所有菜单权限
|
||||
List<PositionMenuVO> positionMenus = positionCompanyMenuService.getMenusByPositionId(positionId);
|
||||
// List<PositionMenuVO> positionMenus = positionCompanyMenuService.getMenusByPositionId(positionId);
|
||||
|
||||
// 这里应该根据菜单ID查询对应的权限码列表
|
||||
// 简化实现:返回空列表
|
||||
|
||||
+14
-3
@@ -16,6 +16,8 @@ import top.xyquan.ecomdmbbackend.modules.sys.model.po.UserPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.vo.LoginVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.vo.UserVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.service.UserService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.service.MediaImageService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
|
||||
import top.xyquan.ecomdmbbackend.utils.JwtUtils;
|
||||
import top.xyquan.ecomdmbbackend.utils.SecurityUtils;
|
||||
import top.xyquan.ecomdmbbackend.utils.TokenPayload;
|
||||
@@ -30,10 +32,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
private final JwtUtils jwtUtils;
|
||||
private final MediaImageService mediaImageService;
|
||||
|
||||
public UserServiceImpl(PasswordEncoder passwordEncoder, JwtUtils jwtUtils) {
|
||||
public UserServiceImpl(PasswordEncoder passwordEncoder, JwtUtils jwtUtils, MediaImageService mediaImageService) {
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
this.jwtUtils = jwtUtils;
|
||||
this.mediaImageService = mediaImageService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,9 +166,16 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements
|
||||
if (StringUtils.hasText(updateUserInfoDTO.getRealName())) {
|
||||
user.setRealName(updateUserInfoDTO.getRealName());
|
||||
}
|
||||
if (StringUtils.hasText(updateUserInfoDTO.getAvatar())) {
|
||||
user.setAvatar(updateUserInfoDTO.getAvatar());
|
||||
|
||||
// 处理头像图片ID
|
||||
if (updateUserInfoDTO.getAvatarImageId() != null) {
|
||||
MediaImageVO avatarImage = mediaImageService.getImageById(updateUserInfoDTO.getAvatarImageId());
|
||||
if (avatarImage != null) {
|
||||
user.setAvatarImageId(updateUserInfoDTO.getAvatarImageId());
|
||||
user.setAvatar(avatarImage.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(updateUserInfoDTO.getPhone())) {
|
||||
user.setPhone(updateUserInfoDTO.getPhone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user