网站代理备案步骤,给公司网站设计,做网站用什么空间好,微商怎么做网站阿里云文档#xff1a;号码认证SDK_号码认证服务(PNVS)-阿里云帮助中心 对于后端大概流程 前端App会传一个token过来 后端通过下面方法解析 如果解析可以获得号码,说明号码认证成功,如果无法正确解析则认证失败 /*** actoken来换取电话号码* param token app端用户授权actok…阿里云文档号码认证SDK_号码认证服务(PNVS)-阿里云帮助中心 对于后端大概流程 前端App会传一个token过来 后端通过下面方法解析 如果解析可以获得号码,说明号码认证成功,如果无法正确解析则认证失败 /*** actoken来换取电话号码* param token app端用户授权actoken* return*/public static String getPhone(String token) {DefaultProfile profile DefaultProfile.getProfile(regionId, accessKeyID, accessKeySecret);//自己阿里云的配置IAcsClient client new DefaultAcsClient(profile);GetMobileRequest request new GetMobileRequest();request.setAccessToken(token);//app端传过来的需要用户授权拿到request.setSysRegionId(regionId);String phone null;try {GetMobileResponse response client.getAcsResponse(request);if(OK.equals(response.getCode())) {System.out.println(response.toString());phone response.getGetMobileResultDTO().getMobile();};System.out.println(new Gson().toJson(response));} catch (ServerException e) {e.printStackTrace();} catch (ClientException e) {System.out.println(ErrCode: e.getErrCode());System.out.println(ErrMsg: e.getErrMsg());System.out.println(RequestId: e.getRequestId());}return phone;} 依赖 dependencygroupIdcom.aliyun/groupIdartifactIdaliyun-java-sdk-core/artifactIdversion4.4.4/version
/dependency
dependencygroupIdcom.aliyun/groupIdartifactIdaliyun-java-sdk-dypnsapi/artifactIdversion1.0.4/version
/dependency