|
@@ -19,6 +19,7 @@ import com.platform.common.validation.group.UpdateGroup;
|
|
|
import com.platform.dao.bean.MyPage;
|
|
|
import com.platform.dao.dto.upms.SysDeptDTO;
|
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
|
+import com.platform.dao.dto.upms.SysUserDeptDTO;
|
|
|
import com.platform.dao.entity.upms.SysMenu;
|
|
|
import com.platform.dao.entity.upms.SysUser;
|
|
|
import com.platform.dao.util.TreeUtil;
|
|
@@ -37,6 +38,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -348,6 +350,29 @@ public class SysUserController {
|
|
|
return new R<>(sysUserService.updateAvatar(avatar));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改用户信息
|
|
|
+ *
|
|
|
+ * @param sysUserDTO :
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("修改用户信息")
|
|
|
+ @PutMapping("/info")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public R updateUserInfo(@RequestBody SysUserDTO sysUserDTO) {
|
|
|
+ String avatar = sysUserDTO.getAvatar();
|
|
|
+ if (StringUtils.isBlank(avatar)) {
|
|
|
+ return R.error(ResultCode.PARAM_INVALID);
|
|
|
+ }
|
|
|
+// return new R<>(sysUserService.updateAvatar(avatar));
|
|
|
+ sysUserService.updateUserInfo(sysUserDTO);
|
|
|
+ SysUserDeptDTO sysUserDeptDTO=new SysUserDeptDTO();
|
|
|
+ sysUserDeptDTO.setUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ sysUserDeptDTO.setDeptId(sysUserDTO.getDeptId());
|
|
|
+ sysUserDeptService.updateDept(sysUserDeptDTO);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 重置密码
|
|
|
*
|