Commit 70646813 authored by libin's avatar libin

客服功能

parent 0ef4f21a
...@@ -70,13 +70,12 @@ public class CustomerServiceBiz { ...@@ -70,13 +70,12 @@ public class CustomerServiceBiz {
CustomerService customerService = new CustomerService(); CustomerService customerService = new CustomerService();
BeanUtils.copyProperties(customerServiceDTO,customerService); BeanUtils.copyProperties(customerServiceDTO,customerService);
customerService.setCreateTime(Instant.now().toEpochMilli()); customerService.setCreateTime(Instant.now().toEpochMilli());
String password = new BCryptPasswordEncoder(UserConstant.PW_ENCORDER_SALT).encode(INIT_PASSWORD);
customerService.setName(String.format("%s%s",NICK_PRE_NAME,customerServiceDTO.getTelphone())); customerService.setName(String.format("%s%s",NICK_PRE_NAME,customerServiceDTO.getTelphone()));
customerService.setIsDel(false); customerService.setIsDel(false);
Map<String,Object> imMap = new HashMap<>(2); Map<String,Object> imMap = new HashMap<>(2);
imMap.put("telephone",customerServiceDTO.getTelphone()); imMap.put("telephone",customerServiceDTO.getTelphone());
imMap.put("password",password); imMap.put("password",INIT_PASSWORD);
imMap.put("nickname",customerService.getName()); imMap.put("nickname",customerService.getName());
BaseResponse imResponse = userBiz.register(imMap); BaseResponse imResponse = userBiz.register(imMap);
String imResult = imResponse.getMessage(); String imResult = imResponse.getMessage();
......
...@@ -257,7 +257,6 @@ public class UserBiz { ...@@ -257,7 +257,6 @@ public class UserBiz {
*/ */
public void updatePasswordByPhone(String telphone,String password){ public void updatePasswordByPhone(String telphone,String password){
Query query = Query.query(Criteria.where("phone").is(telphone)); Query query = Query.query(Criteria.where("phone").is(telphone));
password = new BCryptPasswordEncoder(UserConstant.PW_ENCORDER_SALT).encode(password);
Update update = Update.update("password", password); Update update = Update.update("password", password);
mongoTemplate.updateFirst(query,update,Map.class,"user"); mongoTemplate.updateFirst(query,update,Map.class,"user");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment