|
@@ -36,7 +36,6 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.context.event.EventListener;
|
|
import org.springframework.context.event.EventListener;
|
|
|
-import org.springframework.core.env.Environment;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageImpl;
|
|
import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
@@ -76,7 +75,6 @@ public class UserService {
|
|
|
private AdapayMerchantService adapayMerchantService;
|
|
private AdapayMerchantService adapayMerchantService;
|
|
|
private PointRecordRepo pointRecordRepo;
|
|
private PointRecordRepo pointRecordRepo;
|
|
|
private CollectionService collectionService;
|
|
private CollectionService collectionService;
|
|
|
- private Environment env;
|
|
|
|
|
|
|
|
|
|
public User update(User user) {
|
|
public User update(User user) {
|
|
|
if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN)) {
|
|
if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN)) {
|
|
@@ -152,9 +150,7 @@ public class UserService {
|
|
|
user.setPassword(new BCryptPasswordEncoder().encode(userRegister.getPassword()));
|
|
user.setPassword(new BCryptPasswordEncoder().encode(userRegister.getPassword()));
|
|
|
}
|
|
}
|
|
|
user = userRepo.saveAndFlush(user);
|
|
user = userRepo.saveAndFlush(user);
|
|
|
- if (Arrays.asList(env.getActiveProfiles()).contains("prod")) {
|
|
|
|
|
- nftService.createAccount(user.getId());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ nftService.createAccount(user.getId());
|
|
|
return user;
|
|
return user;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -174,10 +170,7 @@ public class UserService {
|
|
|
if (StringUtils.isNotBlank(inviteCode)) {
|
|
if (StringUtils.isNotBlank(inviteCode)) {
|
|
|
invite = inviteRepo.findFirstByCode(inviteCode).orElse(null);
|
|
invite = inviteRepo.findFirstByCode(inviteCode).orElse(null);
|
|
|
}
|
|
}
|
|
|
- if (!Arrays.asList(env.getActiveProfiles()).contains("test")) {
|
|
|
|
|
- smsService.verify(phone, code);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ smsService.verify(phone, code);
|
|
|
Collection collection = null;
|
|
Collection collection = null;
|
|
|
if (collectionId != null) {
|
|
if (collectionId != null) {
|
|
|
collection = collectionRepo.findById(collectionId).orElseThrow(new BusinessException("无藏品"));
|
|
collection = collectionRepo.findById(collectionId).orElseThrow(new BusinessException("无藏品"));
|