京东云
This commit is contained in:
62
app/realname/controller/Index.php
Normal file
62
app/realname/controller/Index.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace app\realname\controller;
|
||||
|
||||
use Jdcloud\Credentials\Credentials;
|
||||
use Jdcloud\Result;
|
||||
use Jdcloud\Cloudauth\CloudauthClient;
|
||||
|
||||
class Index
|
||||
{
|
||||
private function getCred(){
|
||||
$ak = "JDC_A3B38E573D7404F976472FB42F52";
|
||||
$sk = "C9BAE98F49B42DA2DC02868A75AA3AD8";
|
||||
print("KEY" . $ak . " sk: " . $sk);
|
||||
$cred = new Credentials($ak, $sk);
|
||||
return $cred;
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
|
||||
// $userinfo = json_decode(file_get_contents("php://input"),true);
|
||||
// dd($userinfo);
|
||||
$client = new CloudauthClient([
|
||||
'credentials' => $this->getCred(),
|
||||
'version' => 'latest',
|
||||
'scheme' => 'http'
|
||||
]);
|
||||
|
||||
try{
|
||||
$res = $client->GetAliveUrl([
|
||||
'name' => '郭文涵',
|
||||
'idcard' => '410329200204060032',
|
||||
'returnUrl' => 'http://www.xxxx.wyk'
|
||||
]);
|
||||
dump($res);
|
||||
}catch (\Jdcloud\Exception\JdcloudException $e) {
|
||||
print("ERROR");
|
||||
var_dump($e->getMessage());
|
||||
$this->assertFalse(true);
|
||||
}
|
||||
}
|
||||
|
||||
public function getresult() {
|
||||
$client = new CloudauthClient([
|
||||
'credentials' => $this->getCred(),
|
||||
'version' => 'latest',
|
||||
'scheme' => 'http'
|
||||
]);
|
||||
|
||||
try{
|
||||
$res = $client->GetAliveResult([
|
||||
'token' => '202405281431239af143850e49c5847a',
|
||||
]);
|
||||
dump($res);
|
||||
}catch (\Jdcloud\Exception\JdcloudException $e) {
|
||||
print("ERROR");
|
||||
var_dump($e->getMessage());
|
||||
$this->assertFalse(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user