作者 lyh

gx

... ... @@ -32,8 +32,8 @@ class AiCommandController extends BaseController
* @author :liyuhang
* @method
*/
public function info(Request $request,AiCommandLogic $aiCommandLogic){
$request->validate([
public function info(AiCommandLogic $aiCommandLogic){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'ID不能为空'
... ...
... ... @@ -86,17 +86,15 @@ class AyrReleaseController extends BaseController
if(empty($image_info['ayr_id'])){
//获取发送账号详情
$share_info = $ayrShareLogic->ayr_share_info();
//获取当前图片数据是否已上传到第三方
$arr = (new ImageController())->index($this->param['hash']);
//向第三方存储图片
$param = [
'file'=>($arr->original),//base64编码
'file'=>$ayrShareLogic->base_img_content($this->param['hash']),//base64编码
];
$param_data = $ayrShare->post_media_upload($param,$share_info['profile_key']);
//更新图片库
$ayrShareLogic->save_img($param_data);
}
$this->response('success');
$this->response('success',Code::SUCCESS,$image_info);
}
/**
... ...
... ... @@ -94,7 +94,7 @@ class AyrShareLogic extends BaseLogic
if($info === false){
$this->fail('error');
}
return $this->success();
return $this->success($info);
}
/**
... ... @@ -109,7 +109,7 @@ class AyrShareLogic extends BaseLogic
if($info === false){
$this->fail('error');
}
return $this->success();
return $this->success($info);
}
/**
... ... @@ -134,6 +134,24 @@ class AyrShareLogic extends BaseLogic
}
/**
* @name :(获取图片的base64)base_img_content
* @author :lyh
* @method :post
* @time :2023/5/12 9:28
*/
public function base_img_content($hash){
$imageModel = new ImageModel();
$info = $imageModel->read(['hash'=>$hash]);
if($info === false){
$this->fail('当前数据不存在');
}
$content = file_get_contents($info['path']);
$img_type = $info['type'];
$content = base64_encode($content);
$img_base64 = 'data:image/' . $img_type . ';base64,' . $content;
return $img_base64;
}
/**
* @name :(更新文件库)save_img
* @author :lyh
* @method :post
... ...
... ... @@ -8,4 +8,7 @@ class WebSetting extends Base
{
protected $table = 'gl_web_setting';
//连接数据库
// protected $connection = 'custom_mysql';
}
... ...
... ... @@ -7,4 +7,7 @@ use App\Models\Base;
class WebSettingCountry extends Base
{
protected $table = 'gl_web_setting_country';
//连接数据库
// protected $connection = 'custom_mysql';
}
... ...
... ... @@ -7,4 +7,7 @@ use App\Models\Base;
class WebSettingForm extends Base
{
protected $table = 'gl_web_setting_from';
//连接数据库
// protected $connection = 'custom_mysql';
}
... ...
... ... @@ -7,4 +7,7 @@ use App\Models\Base;
class WebSettingHtml extends Base
{
protected $table = 'gl_web_setting_html';
//连接数据库
// protected $connection = 'custom_mysql';
}
... ...
... ... @@ -7,4 +7,7 @@ use App\Models\Base;
class WebSettingReceiving extends Base
{
protected $table = 'gl_web_setting_receiving';
//连接数据库
// protected $connection = 'custom_mysql';
}
... ...
... ... @@ -7,4 +7,7 @@ use App\Models\Base;
class WebSettingService extends Base
{
protected $table = 'gl_web_setting_service';
//连接数据库
// protected $connection = 'custom_mysql';
}
... ...
... ... @@ -8,6 +8,9 @@ class WebSettingText extends Base
{
protected $table = 'gl_web_setting_text';
//连接数据库
// protected $connection = 'custom_mysql';
//定义常量参数
const TYPE_PAGE = 1;
const TYPE_PRODUCT = 2;
... ...