feat: 获取 OSS 上传文件参数
This commit is contained in:
parent
e25a2c29ea
commit
3cd36d1301
25
application/worker/controller/Common.php
Normal file
25
application/worker/controller/Common.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace app\worker\controller;
|
||||
|
||||
use app\common\controller\WorkerApi;
|
||||
|
||||
class Common extends WorkerApi
|
||||
{
|
||||
public function ossParams()
|
||||
{
|
||||
$name = $this->request->post('name');
|
||||
if (empty($name)) {
|
||||
$this->error('文件名必填');
|
||||
}
|
||||
|
||||
$md5 = md5($name);
|
||||
$auth = new \addons\alioss\library\Auth();
|
||||
$params = $auth->params($name, $md5);
|
||||
$params['OSSAccessKeyId'] = $params['id'];
|
||||
$params['success_action_status'] = 200;
|
||||
$params['cdnurl'] = cdnurl('', true);
|
||||
|
||||
$this->success('', null, $params);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user