聚石塔,御城河接入,御河城安全整改demo
生活随笔
收集整理的這篇文章主要介紹了
聚石塔,御城河接入,御河城安全整改demo
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
去年做了御城河接入,怕忘記和丟失代碼,所以在這里做個記錄,也是方便其他人 操作使用吧
我用的是PHP框架? tp5,如果你也是那么你復(fù)制后改一下參數(shù)就哦了
完整文件到這里下載? 傳送-->
配置文件
這個里主要代碼
<?php /*** Created by PhpStorm.* User: 伍先生* Date: 2019/8/14* Time: 10:59* Info: 說明*/namespace app\api\controller;class TestController extends BaseTestController {/*** 1.0 風(fēng)險計算(computeRisk)接口* https://php.z55.club/api/test/computeRisk*/public function computeRisk(){$url = $this->accountHost . "computeRisk";$params= $this->isVerifyPassedParam();$params['time'] = date('Y-m-d H:i:s');$params['appKey'] = $this->topAppkey;$sdk = new YchClientController($this->appkey, $this->secret);$rsp = $sdk->send($url ,$params);$this->parseResult($rsp);}/*** 2.0 獲取二次驗證地址(getVerifyUrl)接口(僅限B/S架構(gòu)調(diào)用)* https://php.z55.club/api/test/getVerifyUrl*/public function getVerifyUrl(){$url = $this->accountHost . "getVerifyUrl";$params = $this->isVerifyPassedParam();$params['sessionId'] = md5(time());$params['mobile'] = '1500000000';$params['appId'] = '江蘇移動號卡';$params['redirectURL'] = urlencode('https://php.z55.club/api/test/isVerifyPassed');$params['userId'] = $this->defaultParam["userId"];$params['userIp'] = $this->defaultParam["userIp"];$params['ati'] = $this->defaultParam["ati"];$params['appId'] = $this->topAppkey;$params['appName'] = $this->defaultParam["appName"];$params['appKey'] = $this->appkey;$params['time'] = date('Y-m-d H:i:s');$sdk = new YchClientController($this->appkey, $this->secret);$rsp = $sdk->send($url ,$params);//verifyUrlecho $rsp;die;$rsp_json = json_decode($rsp, true);return redirect($rsp_json['verifyUrl']);}/*** 3.0 獲取二次驗證令牌(getVerifyToken) 接口(僅限C/S架構(gòu)調(diào)用)* https://php.z55.club/api/test/getVerifyToken*/public function getVerifyToken(){$url = $this->accountHost . "getVerifyToken";$params = $this->isVerifyPassedParam();$params['sessionId'] =md5(time());$params['mobile'] = '123456';$params['appId'] = '江蘇移動號卡';$params['appKey'] = '123456';$sdk = new YchClientController($this->appkey, $this->secret);$rsp = $sdk->send($url ,$params);$rsp_json = json_decode($rsp, true);return $rsp_json['token'];}/*** 4.0 發(fā)送驗證碼(sendVerifyCode)接口(僅限C/S架構(gòu)調(diào)用)* https://php.z55.club/api/test/sendVerifyCode*/public function sendVerifyCode() {$url = "http://account.ose.aliyun.com/sendVerifyCode";$params['token'] = $this->getVerifyToken();$params['time'] = date('Y-m-d H:i:s');$params['appKey'] = $this->topAppkey;$sdk = new YchClientController($this->appkey, $this->secret);$rsp = $sdk->send($url ,$params);$this->parseResult($rsp);}/*** 5.0 檢查驗證碼(checkVerifyCode)接口(C/S架構(gòu)調(diào)用)* https://php.z55.club/api/test/checkVerifyCode?t=102560*/public function checkVerifyCode(){$url = $this->accountHost . "checkVerifyCode";$params['token'] = $this->getVerifyToken();$params['captcha'] = input('t');$params['time'] = date('Y-m-d H:i:s');$params['appKey'] = $this->appkey;$sdk = new YchClientController($this->appkey, $this->secret);$rsp = $sdk->send($url ,$params);$this->parseResult($rsp);}/*** 6.0 是否驗證通過(isVerifyPassed)接口* https://php.z55.club/api/test/isVerifyPassed*/public function isVerifyPassed() {$url = $this->accountHost . "isVerifyPassed";$params['token'] = input('token');$params['time'] = date('Y-m-d H:i:s');$params['appKey'] = $this->topAppkey;$sdk = new YchClientController($this->appkey, $this->secret);$rsp = $sdk->send($url ,$params);$this->parseResult($rsp);}}基本順序就是按著1-6執(zhí)行就行
總結(jié)
以上是生活随笔為你收集整理的聚石塔,御城河接入,御河城安全整改demo的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 图片放大后不清楚怎么办?
- 下一篇: 测试每秒点击速度的软件,测试点击速度