config and user bug
This commit is contained in:
@@ -130,24 +130,32 @@ public class MyUserController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 修改用户信息
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:user:update")
|
||||
public R update(@RequestBody MyUserEntity user){
|
||||
|
||||
if (!StringUtils.isEmpty(user.getPassword())) {
|
||||
String password = user.getPassword();
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
userService.updateById(user);
|
||||
}else{
|
||||
userService.update(user);
|
||||
}
|
||||
|
||||
userService.updateById(user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户密码
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateUserPassword")
|
||||
public R updateUserPassword(@RequestBody MyUserEntity user){
|
||||
String password = user.getPassword();
|
||||
if(password.equals(null)){
|
||||
return R.error("密码不能为空");
|
||||
}
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
userService.updateById(user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface MyUserDao extends BaseMapper<MyUserEntity> {
|
||||
|
||||
void update(MyUserEntity user);
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public interface MyUserService extends IService<MyUserEntity> {
|
||||
//电子书购买
|
||||
String buyEbook(String userId, String bookId,String couponId);
|
||||
|
||||
void update (MyUserEntity user);
|
||||
//第三方微信登录
|
||||
R getUserInfoByApp(UserAppAuthorEntity userAppAuthorEntity);
|
||||
|
||||
|
||||
@@ -352,16 +352,6 @@ public class MyUserServiceImpl extends ServiceImpl<MyUserDao, MyUserEntity> impl
|
||||
return "购买成功!";
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param user
|
||||
*/
|
||||
@Override
|
||||
public void update(MyUserEntity user) {
|
||||
myUserDao.update(user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 微信授权登录
|
||||
|
||||
Reference in New Issue
Block a user