第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Java 實(shí)名認(rèn)證(阿里云之芝麻信用_欺詐信息驗(yàn)證)

標(biāo)簽:
Java
Java 实名认证(阿里云之芝麻信用_欺诈信息验证)

图片描述

对于项目中有实名认证和相关认证的阿里云类似市场提供了很多开放接口。例如下面这些的。

图片描述

首先既然是阿里云提供的就需要申请阿里云的AppCode,只是走个手续,让人家知道谁在用。

图片描述

/**
        * 实名认证
        *
        * @param userId
        * @param certNo
        * @param authType
        * @return
        */
       public boolean certification_authentication(int userId, String certNo, String authType) {
             UserEntity entity = userService.findUserById(userId);

           Map<String, String> headers = new HashMap<String, String>();
           //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
           headers.put("Authorization", "APPCODE " + AppCode);
           //根据API的要求,定义相对应的Content-Type
           headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
           Map<String, String> querys = new HashMap<String, String>();
           Map<String, String> bodys = new HashMap<String, String>();
           bodys.put("bizNo", "ZM201612013000000242400404124269");
           bodys.put("name", entity.getName());
           bodys.put("certNo", certNo);
           bodys.put("certType", "IDENTITY_CARD");

           try {
              /**
              * 相应的依赖请参照
              * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
              */
              HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
              String return_obj = EntityUtils.toString(response.getEntity());
              JSONObject object =  JSON.parseObject(return_obj);
              if(object.getString("success").equals("true")) {
                    return true;
              }
              //获取response的body
              //System.out.println(EntityUtils.toString(response.getEntity()));
           } catch (Exception e) {
              e.printStackTrace();
           }
             return false;

       }
點(diǎn)擊查看更多內(nèi)容
1人點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消