...
|
...
|
@@ -109,11 +109,11 @@ class Notify extends Api |
|
|
*/
|
|
|
public function notifyQiniu()
|
|
|
{
|
|
|
$body = file_get_contents('php://input');
|
|
|
if ($body) {
|
|
|
parse_str($body, $arr);
|
|
|
if($this->request->isPost()) {
|
|
|
$param = $this->request->param();
|
|
|
Db::name('ceshi')->insert(['content'=>json_encode($arr,JSON_UNESCAPED_UNICODE)]);
|
|
|
if($arr && isset($arr['code']) && $arr['code'] == 0){
|
|
|
// 判断七牛云回调code是否为完成
|
|
|
if(isset($param['code']) && $param['code'] == 0) {
|
|
|
$url = '/' . $arr['key'];
|
|
|
$info = Attachment::get(['url'=>$url]);
|
|
|
Db::name('ceshi')->insert(['content'=>$info ? '有' : '无']);
|
...
|
...
|
@@ -131,7 +131,7 @@ class Notify extends Api |
|
|
'imageframes' => 1,
|
|
|
'mimetype' => "image/" . (isset($imageInfo['format']) ? $imageInfo['format'] : ''),
|
|
|
'extparam' => '',
|
|
|
'url' => '/' . $arr['key'],
|
|
|
'url' => $url,
|
|
|
'uploadtime' => time(),
|
|
|
'storage' => 'qiniu'
|
|
|
);
|
...
|
...
|
@@ -139,6 +139,7 @@ class Notify extends Api |
|
|
}
|
|
|
return json(['ret' => 'success', 'code' => 1, 'data' => ['url' => $url]]);
|
|
|
}
|
|
|
return json(['ret' => 'failed']);
|
|
|
}
|
|
|
return json(['ret' => 'failed']);
|
|
|
}
|
...
|
...
|
|