|
@ -9,6 +9,7 @@ import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import org.springframework.cache.annotation.CacheConfig; |
|
|
import org.springframework.cache.annotation.CacheConfig; |
|
|
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.util.ObjectUtils; |
|
|
import org.springframework.util.ObjectUtils; |
|
@ -58,6 +59,8 @@ public class UserServiceImpl implements UserSevice { |
|
|
if (!ObjectUtils.isEmpty(sUser)){ |
|
|
if (!ObjectUtils.isEmpty(sUser)){ |
|
|
throw new Exception("已存在此用户"); |
|
|
throw new Exception("已存在此用户"); |
|
|
} |
|
|
} |
|
|
|
|
|
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
|
|
|
|
|
user.setPassword(passwordEncoder.encode("123")); |
|
|
return userMapper.add(user); |
|
|
return userMapper.add(user); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|