作者 lyh

gx

... ... @@ -15,6 +15,15 @@ use Illuminate\Support\Facades\DB;
class AyrReleaseController extends BaseController
{
/**
* @name :(获取当前用户已绑定的社交链接)info
* @author :lyh
* @method :post
* @time :2023/5/9 16:00
*/
public function info(){
}
/**
* @name :(发布社交)send_post
* @author :lyh
* @method :post
... ... @@ -25,6 +34,14 @@ class AyrReleaseController extends BaseController
try {
//获取发送账号详情
$share_info = $ayrShareLogic->ayr_share_info();
$data = [
'image'=>explode(',',$this->param['image']),
'file'=>explode(',',$this->param['file'])
];
//参数处理
$image_file = $this->_extents($data);
$this->param['mediaUrls'] = $image_file;
//统一生成链接
$param = [
'post'=>$this->param['content'],
'platforms'=>$this->param['platforms'],
... ...
... ... @@ -82,7 +82,7 @@ class FileController
}
}
/**
* @name :上传图片
* @name :上传
* @return void
* @author :liyuhang
* @method
... ... @@ -96,12 +96,13 @@ class FileController
return $hash;
}
$url = $this->path;
$res = $this->request->file('image')->move($url);
$fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension();
$res = $files->move($url,$fileName);
if ($res === false) {
return $this->response($files->getError(), Code::USER_ERROR);
}
$data = [
'path' => $url.'/'.$res->getClientOriginalName(),
'path' => $url.'/'.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash,
... ... @@ -133,12 +134,13 @@ class FileController
continue;
}
$url = $this->path;
$res = $file->move($url);
$fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension();
$res = $file->move($url,$fileName);
if ($res === false) {
return $this->response($file->getError(), Code::USER_ERROR);
}
$save_data[] = [
'path' => $url.'/'.$res->getClientOriginalName(),
'path' => $url.'/'.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash,
... ...
... ... @@ -117,12 +117,13 @@ class ImageController
return $hash;
}
$url = $this->path;
$res = $this->request->file('image')->move($url);
$fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension();
$res = $files->move($url,$fileName);
if ($res === false) {
return $this->response($files->getError(), Code::USER_ERROR);
}
$data = [
'path' => $url.'/'.$res->getClientOriginalName(),
'path' => $url.'/'.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash,
... ... @@ -154,6 +155,7 @@ class ImageController
* @return type
*/
private function multi($files) {
if (!is_array($files)) {
$files = [$files];
}
... ... @@ -168,12 +170,13 @@ class ImageController
continue;
}
$url = $this->path;
$res = $file->move($url);
$fileName = uniqid().rand(10000,99999).'.'.$file->getClientOriginalExtension();
$res = $file->move($url,$fileName);
if ($res === false) {
return $this->response($file->getError(), Code::USER_ERROR);
}
$save_data[] = [
'path' => $url.'/'.$file->getClientOriginalName(),
'path' => $url.'/'.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
'updated_at'=>date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
... ...