京东云

This commit is contained in:
“wanyongkang”
2024-05-28 17:04:50 +08:00
parent f644932afb
commit f3c7432100
672 changed files with 209344 additions and 6593 deletions

View 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);
}
}
}