作者 lyh

gx

... ... @@ -48,6 +48,75 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K
}
/**
* @name :(创建子账户配置文件)post_create_profiles
* @author :lyh
* @method :post
* @time :2023/5/5 15:16
*/
public function post_create_profiles($data){
$param = [
'title'=>$data['title'],
];
$url = $this->path.'/api/profiles/profile';
return $this->http_click('post',$url,$param);
}
/**
* @name :(删除子账户配置文件)deleted_profiles
* @author :lyh
* @method :post
* @time :2023/5/5 15:16
*/
public function deleted_profiles($data){
$param = [
'title'=>$data['title'],
'profileKey'=>$this->profile_key,
];
$url = $this->path.'/api/profiles/profile';
return $this->http_click('delete',$url,$param);
}
/**
* @name :(跳转第三方生成jwt令牌)post_generate_jwt
* @author :lyh
* @method :post
* @time :2023/5/5 18:07 https://app.ayrshare.com/api/profiles/generateJWT
*/
public function post_generate_jwt($data,$domain = 'globalso'){
$param = [
'domain'=>$domain,
'privateKey'=>$this->private_key,
'profileKey'=>$data['profileKey'],
// 'logout'=>true
];
$url = $this->path.'/api/profiles/generateJWT';
return $this->http_click('post',$url,$param);
}
/**
* @name :(获取当前用户的配置文件)get_profiles
* @author :lyh
* @method :post
* @time :2023/5/6 16:01
*/
public function get_profiles(){
}
/**
* @name :(通过用户名获取社交账号)get_brand_user
* @author :lyh https://app.ayrshare.com/api/brand/byUser
* @method :post
* @time :2023/5/5 17:32
*/
public function get_brand_user($param){
//[[platforms=>'instagram','instagramUser'=>'user']]
$str = '';
foreach ($param as $k =>$v){
//platforms[0]=instagram&platforms[1]=twitter&twitterUser=ayrshare&instagramUser=nygiants',
}
$url = $this->path.'/api/brand/byUser?'.$str;
return $this->http_click('get',$url);
}
/**
* @name :获取过去30天发布的历史记录(1-30)
* @author :lyh
* @method :get
... ... @@ -145,67 +214,6 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K
}
/**
* @name :(创建子账户配置文件)post_create_profiles
* @author :lyh
* @method :post
* @time :2023/5/5 15:16
*/
public function post_create_profiles($data){
$param = [
'title'=>$data['title'],
];
$url = $this->path.'/api/profiles/profile';
return $this->http_click('post',$url,$param);
}
/**
* @name :(删除子账户配置文件)deleted_profiles
* @author :lyh
* @method :post
* @time :2023/5/5 15:16
*/
public function deleted_profiles($data){
$param = [
'title'=>$data['title'],
'profileKey'=>$this->profile_key,
];
$url = $this->path.'/api/profiles/profile';
return $this->http_click('delete',$url,$param);
}
/**
* @name :(通过用户名获取社交账号)get_brand_user
* @author :lyh https://app.ayrshare.com/api/brand/byUser
* @method :post
* @time :2023/5/5 17:32
*/
public function get_brand_user($param){
//[[platforms=>'instagram','instagramUser'=>'user']]
$str = '';
foreach ($param as $k =>$v){
//platforms[0]=instagram&platforms[1]=twitter&twitterUser=ayrshare&instagramUser=nygiants',
}
$url = $this->path.'/api/brand/byUser?'.$str;
return $this->http_click('get',$url);
}
/**
* @name :(跳转第三方生成jwt令牌)post_generate_jwt
* @author :lyh
* @method :post
* @time :2023/5/5 18:07 https://app.ayrshare.com/api/profiles/generateJWT
*/
public function post_generate_jwt($data,$domain = 'globalso'){
$param = [
'domain'=>$domain,
'privateKey'=>$this->private_key,
'profileKey'=>$data['profileKey'],
'logout'=>true
];
$url = $this->path.'/api/profiles/generateJWT';
return $this->http_click('post',$url,$param);
}
/**
* 发送http post,get,put,delete请求
* @param type $url
* @param type $post_data
... ...
... ... @@ -101,8 +101,9 @@ class BlogCategoryLogic extends BaseLogic
if($info !== false){
$this->fail('当前分类名称已存在');
}
$this->param['operator_id'] = $this->user['id'];
$this->edit($this->param,$this->param['id']);
$this->edit($this->param,['id'=>$this->param['id']]);
return $this->success();
}
... ...
... ... @@ -105,14 +105,6 @@ class BlogLogic extends BaseLogic
try {
//是否有图片更新
if(isset($this->param['image']) && is_file($this->param['image'])){
//查看当前用户是否已有头像
if($info !== false && !empty($info['image'])){
//TODO::删除资源
$imageModel = new Image();
$image_info = $imageModel->read(['hash'=>$info['image']],['id','path']);
shell_exec('sudo rm -rf '.$image_info['path'] .' ./../uploads/images/cache_'. $info['image'] . '*');
$imageModel->del(['hash'=>$info['image']]);
}
$this->param['image'] = $this->upload();
}
RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $this->param['id'], $this->user['project_id']);
... ...