|
|
|
@@ -249,6 +249,9 @@ public class WxInfoController extends BaseController { |
|
|
|
if (StringUtils.isBlank(iv)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(openId)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "openId 不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
WxAppinfo wxAppinfo = getAppInfo(appId); |
|
|
|
if (wxAppinfo == null) { |
|
|
|
@@ -261,7 +264,8 @@ public class WxInfoController extends BaseController { |
|
|
|
TenantEntity tenantEntity = new TenantEntity(); |
|
|
|
tenantEntity.setTenantId(wxAppinfo.getTenantId()); |
|
|
|
|
|
|
|
CUser buser = getCUser(); |
|
|
|
CUser buser = cuserFactory.getBUserService(appPlat).getByOpenId(openId,tenantEntity.getTenantId()); |
|
|
|
|
|
|
|
try { |
|
|
|
// 解密 |
|
|
|
String phone = cuserFactory.getBUserService(appPlat).decryptPhoneNoInfo(encryptedData, iv, buser, wxAppinfo, isFmOpen); |
|
|
|
@@ -316,14 +320,22 @@ public class WxInfoController extends BaseController { |
|
|
|
if (StringUtils.isBlank(iv)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(openId)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "openId 不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
CUser buser = getCUser(); |
|
|
|
WxAppinfo wxAppinfo = wxAppinfoService.getByAppId(buser.getAppId()); |
|
|
|
WxAppinfo wxAppinfo = getAppInfo(appId); |
|
|
|
if(wxAppinfo == null){ |
|
|
|
return new ResultData(ErrorCode.APP_ID_NOT_FOUND); |
|
|
|
} |
|
|
|
EnumAppPlat appPlat = EnumAppPlat.getByCode(wxAppinfo.getPlat()); |
|
|
|
if(appPlat == null){ |
|
|
|
return new ResultData(ErrorCode.APP_PLAT_ERROR); |
|
|
|
} |
|
|
|
CUser buser = cuserFactory.getBUserService(appPlat).getByOpenId(openId,wxAppinfo.getTenantId()); |
|
|
|
|
|
|
|
try { |
|
|
|
String phone = cuserFactory.getBUserService(buser.getAppPlat()).decryptPhoneNoInfo(encryptedData, iv, buser, wxAppinfo, isFmOpen); |
|
|
|
String phone = cuserFactory.getBUserService(appPlat).decryptPhoneNoInfo(encryptedData, iv, buser, wxAppinfo, isFmOpen); |
|
|
|
resultMap.put("msg", "授权手机成功!"); |
|
|
|
resultMap.put("phone", phone); |
|
|
|
return new ResultData(resultMap); |
|
|
|
|