Browse Source

auth版本号+1:新增接口getresiwxphone

dev_shibei_match
yinzuomei 5 years ago
parent
commit
9820c353e9
  1. 2
      epmet-auth/deploy/docker-compose-dev.yml
  2. 2
      epmet-auth/pom.xml
  3. 1
      epmet-auth/src/main/java/com/epmet/controller/LoginController.java
  4. 5
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

2
epmet-auth/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.31
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.32
ports:
- "8081:8081"
network_mode: host # 使用现有网络

2
epmet-auth/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.31</version>
<version>0.3.32</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>

1
epmet-auth/src/main/java/com/epmet/controller/LoginController.java

@ -108,7 +108,6 @@ public class LoginController {
**/
@PostMapping("getresiwxphone")
public Result getResiWxPhone(@RequestBody ResiWxPhoneFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiWxPhoneFormDTO.AddUserInternalGroup.class);
String phone = loginService.getResiWxPhone(formDTO);
if (StringUtils.isNotBlank(phone) && !"null".equals(phone)) {
return new Result().ok(phone);

5
epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

@ -12,6 +12,7 @@ import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.CpUserDetailRedis;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.UserDTO;
import com.epmet.dto.UserWechatDTO;
import com.epmet.dto.form.*;
@ -135,6 +136,7 @@ public class LoginServiceImpl implements LoginService {
public String getResiWxPhone(ResiWxPhoneFormDTO formDTO) {
String phone="";
try {
ValidatorUtils.validateEntity(formDTO, ResiWxPhoneFormDTO.AddUserInternalGroup.class);
WxMaService wxMaService = wxMaServiceUtils.resiWxMaService();
WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(formDTO.getWxCode());
WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(wxMaJscode2SessionResult.getSessionKey(),
@ -146,6 +148,9 @@ public class LoginServiceImpl implements LoginService {
} catch (WxErrorException e) {
e.printStackTrace();
log.error(String.format("获取用户微信绑定的手机号接口异常"));
} catch(Exception e){
e.printStackTrace();
log.error(String.format("获取用户微信绑定的手机号接口异常"));
}
return phone;
}

Loading…
Cancel
Save