作者 Your Name

Merge branch 'dev' of http://47.244.231.31:8099/zhl/globalso-v6 into dev

... ... @@ -9,7 +9,7 @@ use GuzzleHttp\Client;
*/
class AyrShare
{
public $path = 'https://app.ayrshare.com/api';
public $path = 'https://app.ayrshare.com';
//api_key
public $api_key = 'G8GQW3X-XBTMGXW-QPDDZ9A-WE1Z5SB';
//系统设置
... ... @@ -228,9 +228,9 @@ class AyrShare
$client = new Client();
try {
$res = $client->request(strtoupper($method), $url, $post_data)->getBody()->getContents();
return $res;
return (array)json_decode($res);
} catch (\Exception $e) {
return json_encode(["status"=>"fail","message"=>$e->getMessage()]);
return ["status"=>"fail","message"=>$e->getMessage()];
}
}
}
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bside\AyrShare;
use App\Enums\Common\Code;
use App\Helper\AyrShare as AyrShareHelper;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\AyrShare\AyrShareLogic;
use App\Models\AyrShare\AyrShare as AyrShareModel;
/**
... ... @@ -29,16 +30,8 @@ class AyrShareController extends BaseController
* @method :post
* @time :2023/5/5 16:44
*/
public function create_account(){
$data = [
'title'=>md5(uniqid().time())
];
$ayrShareHelper = new AyrShareHelper();
$res = $ayrShareHelper->post_create_profiles($data);
var_dump($res);
die();
if($res === false){
}
public function create_account(AyrShareLogic $ayrShareLogic){
$ayrShareLogic->ayr_share_add();
$this->response('success');
}
}
... ...
... ... @@ -2,6 +2,7 @@
namespace App\Http\Logic\Bside\AyrShare;
use App\Helper\AyrShare as AyrShareHelper;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\AyrShare\AyrShare;
... ... @@ -15,4 +16,25 @@ class AyrShareLogic extends BaseLogic
$this->param = $this->requestAll;
}
/**
* @name :(创建账号并绑定)ayr_add
* @author :lyh
* @method :post
* @time :2023/5/6 9:19
*/
public function ayr_share_add(){
$param = [
'title'=>md5(uniqid().time())
];
$ayrShareHelper = new AyrShareHelper();
$res = $ayrShareHelper->post_create_profiles($param);
if($res['status'] == 'fail'){
$this->response('绑定失败');
}
$data = [
'title'=>$res['title'],
''
];
$this->model->add($data);
}
}
... ...
... ... @@ -173,7 +173,7 @@ class BlogLogic extends BaseLogic
*/
public function blog_status(){
$this->param['operator_id'] = $this->user['id'];
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
$rs = $this->model->edit($this->param,['id'=>['in',$this->param['id']]]);
if($rs === false){
$this->fail('error');
}
... ...
... ... @@ -134,7 +134,7 @@ class NewsLogic extends BaseLogic
*/
public function news_status(){
$this->param['operator_id'] = $this->user['id'];
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
$rs = $this->model->edit($this->param,['id'=>['in',$this->param['id']]]);
if($rs === false){
$this->fail('error');
}
... ...
<?php
namespace App\Http\Requests\Bside\AyrShare;
use Illuminate\Foundation\Http\FormRequest;
class AyrShareRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
}
... ...