|
|
|
@ -1,15 +1,6 @@
|
|
|
|
|
package com.ruoyi.web.controller.system;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
|
|
import com.ruoyi.common.constant.UserConstants;
|
|
|
|
@ -20,10 +11,14 @@ import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
|
|
import com.ruoyi.framework.web.service.TokenService;
|
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 个人信息 业务处理
|
|
|
|
@ -61,12 +56,12 @@ public class SysProfileController extends BaseController
|
|
|
|
|
@PutMapping
|
|
|
|
|
public AjaxResult updateProfile(@RequestBody SysUser user)
|
|
|
|
|
{
|
|
|
|
|
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
|
if (StrUtil.isNotEmpty(user.getPhonenumber())
|
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotEmpty(user.getEmail())
|
|
|
|
|
if (StrUtil.isNotEmpty(user.getEmail())
|
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
|
|
|