feat : ali
This commit is contained in:
@@ -10,6 +10,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\Third;
|
||||
|
||||
use App\Exception\AdminException;
|
||||
use App\Service\Admin\BaseService;
|
||||
use App\Service\ServiceTrait\Common\AliStsTrait;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
@@ -94,6 +95,16 @@ class AliStsService extends BaseService
|
||||
|
||||
$res = $this->getAliStsControls($payload);
|
||||
$this->log->info(__CLASS__.':'.__FUNCTION__.':授权oss信息:'.json_encode($res));
|
||||
return $this->return->success('success');
|
||||
|
||||
$aliResponse = $res->body->credentials;
|
||||
if (empty($aliResponse)) throw new AdminException('授权失败');
|
||||
|
||||
return $this->return->success('success',[
|
||||
'access_key_id' => $aliResponse['accessKeyId'],
|
||||
'access_key_secret' => $aliResponse['accessKeySecret'],
|
||||
'expiration' => $aliResponse['expiration'],
|
||||
'security_token' => $aliResponse['securityToken'],
|
||||
'callback_url' => config('ali.callback_url')
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user