作者 邓超

Merge branch 'develop' into dc

... ... @@ -124,15 +124,6 @@ class Handler extends ExceptionHandler
} else {
$code = Code::SYSTEM_ERROR();
}
//钉钉通知错误信息
if (in_array(config('app.env'), ['test', 'production']) && (in_array(substr($code, 0, 1), ['B', 'C']))) {
$exceptionMessage = "路由:" . Route::current()->uri .
"-----错误CODE:" . $exception->getCode() .
"-----错误message:" . $exception->getMessage() .
'------错误文件:' . $exception->getFile() . '-------错误行数:' .
$exception->getLine();
(new DingService())->handle(['keyword' => "ERROR", 'msg' => config('app.env') . '环境报错:' . $exceptionMessage, 'isAtAll' => false]);
}
//开启debug 错误原样输出
$debub = config('app.debug');
$message = $debub ? $message : ($code->description ?? $message);
... ...
... ... @@ -111,10 +111,10 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K
* @param :platforms: "facebook", "fbg", "twitter",
* "linkedin", "instagram","youtube", "reddit" ,"telegram""
*/
public function post_send_msg($param){
public function post_send_msg($param,$api_key){
//平台参数处理
$this->headers['Accept-Encoding'] = 'gzip';
$this->headers['Authorization'] = $this->headers['Authorization'].$param['profile_key'];
$this->headers['Authorization'] = $this->headers['Authorization'].$api_key;
$url = $this->path.'/api/post';
return $this->http_click('posts',$url,$param,$this->headers);
}
... ...
... ... @@ -127,15 +127,10 @@ class Common
* @method :post
* @time :2023/5/9 10:47
*/
public static function uniqueMultiArray($multiArray) {
$flatArray = array();
foreach ($multiArray as $item) {
if (is_array($item)) {
$flatArray = array_merge($flatArray, uniqueMultiArray($item));
} else {
$flatArray[] = $item;
}
}
return array_map("unserialize", array_unique(array_map("serialize", $flatArray)));
public static function uniqueMultiArray($arr) {
$arr = array_map('serialize', $arr);
$arr = array_unique($arr);
$arr = array_map('unserialize', $arr);
return $arr;
}
}
... ...
... ... @@ -2,8 +2,11 @@
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\AyrReleaseLogic;
use App\Http\Logic\Bside\AyrShare\AyrShareLogic;
/**
* @name:社交发布
... ... @@ -11,15 +14,95 @@ use App\Http\Logic\Bside\AyrShare\AyrReleaseLogic;
class AyrReleaseController extends BaseController
{
/**
* @name :(获取当前用户已绑定的社交链接)info
* @author :lyh
* @method :post
* @time :2023/5/9 16:00
*/
public function info(AyrShareLogic $ayrShareLogic){
$info = $ayrShareLogic->ayr_share_info();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @name :(发布社交)send_post
* @author :lyh
* @method :post
* @time :2023/5/9 9:36
*/
public function send_post(AyrReleaseLogic $ayrReleaseLogic){
public function send_post(AyrReleaseLogic $ayrReleaseLogic,AyrShareLogic $ayrShareLogic){
// DB::beginTransaction();
// try {
//获取发送账号详情
$share_info = $ayrShareLogic->ayr_share_info();
$data = [
'images'=>$this->param['image'],
'files'=>$this->param['file'],
];
//参数处理
$image_data = $this->image_file_param($data);
$this->param['mediaUrls'] = array_merge($image_data['images_link'],$image_data['files_link']);
var_dump($this->param);
die();
//统一生成链接
$param = [
'post'=>$this->param['content'],
'platforms'=>$this->param['platforms'],
'mediaUrls'=>$this->param['mediaUrls'],//参数处理
];
//发送请求注册社交用户
$ayrShareHelper = new AyrShareHelper();
$res = $ayrShareHelper->post_send_msg($param,$share_info['profile_key']);
$this->response('success',Code::SUCCESS,$res);
//保存数据库
$ayrReleaseLogic->release_add();
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->response('error',Code::USER_ERROR);
// }
}
/**
* @name :(上传第三方参数参数)get_param
* @author :lyh
* @method :post
* @time :2023/5/10 10:27
*/
public function image_file_param($data) {
if (empty($data) || !is_array($data)) {
return empty($data) ? is_array($data) ? [] : '' : $data;
}
foreach ($data as $k => $v) {
if (is_array($v)) {
$data[$k] = $this->_extents($v);
} else {
if (is_null($v)) {
$data[$k] = '';
continue;
}
//获取操作人
switch ((string) $k) {
case 'image':
$data['image_link'] = url('/b/image/' . $v . '/2');
break;
case 'images':
$v = explode(',',$v);
foreach ($v as $k1=>$v1){
$data['images_link'][$k1] = url('/b/image/' . $v1 . '/2');
}
break;
case 'file':
$data['file_link'] = url('/b/file_hash/' . $v .'/mp4');
break;
case 'files':
$v = explode(',',$v);
foreach ($v as $k1=>$v1){
$data['files_link'][$k1] = url('/b/file_hash/' . $v1 . '/mp4');
}
break;
}
}
}
return $data;
}
}
... ...
... ... @@ -21,14 +21,26 @@ class AyrShareController extends BaseController
*/
public function lists(AyrShareModel $ayrShareModel){
$lists = $ayrShareModel->lists($this->map,$this->page,$this->row,'id',['*']);
$ayrShareHelper = new AyrShareHelper();
foreach ($lists['list'] as $k=>$v){
$lists['list'][$k]['ayr'] = $ayrShareHelper->get_profiles_users($v['profile_key']);
}
$this->response('列表',Code::SUCCESS,$lists);
}
/**
* @name :(定时更新)save_account
* @author :lyh
* @method :post
* @time :2023/5/9 14:39
*/
public function save_account(AyrShareLogic $ayrShareLogic){
$info = $ayrShareLogic->ayr_share_info();
$ayrShareHelper = new AyrShareHelper();
$share_info = $ayrShareHelper->get_profiles_users($info['profile_key']);
if(isset($share_info['activeSocialAccounts'])){
$str = json_encode($share_info['activeSocialAccounts']);
$ayrShareLogic->ayr_share_edit(['bind_plat_from'=>$str]);
}
$this->response('success');
}
/**
* @name :(创建ayr_share账户)create_account
* @author :lyh
* @method :post
... ... @@ -66,7 +78,7 @@ class AyrShareController extends BaseController
'title'=>$info['title'],
'profileKey'=>$info['profile_key']
];
//发送请求注册社交用户
//发送请求删除社交用户
$ayrShareHelper = new AyrShareHelper();
$res = $ayrShareHelper->deleted_profiles($data);
if($res['status'] == 'fail'){
... ...
... ... @@ -41,16 +41,6 @@ class BaseController extends Controller
$this->set_user_log();
}
}
/**
* @name :ceshi
* @author :lyh
* @method :post
* @time :2023/5/9 11:43
*/
public function ceshi(){
}
/**
* @name 参数过滤
* @return void
... ... @@ -152,7 +142,6 @@ class BaseController extends Controller
* @method
*/
protected function _extents($data) {
if (empty($data) || !is_array($data)) {
return empty($data) ? is_array($data) ? [] : '' : $data;
}
... ... @@ -169,6 +158,12 @@ class BaseController extends Controller
case 'image':
$data['image_link'] = url('/b/image/' . $v);
break;
case 'images':
$v = explode(',',$v);
foreach ($v as $k1=>$v1){
$data['images_link'][$k1] = url('/b/image/' . $v1);
}
break;
case 'file':
$data['file_link'] = url('/b/file_hash/' . $v);
break;
... ...
... ... @@ -11,6 +11,7 @@ use App\Http\Logic\Bside\Setting\WebSettingServiceLogic;
*/
class WebSettingServiceController extends BaseController
{
const TYPE_CODE = 6;
/**
* @name :lists
* @author :lyh
... ... @@ -19,6 +20,12 @@ class WebSettingServiceController extends BaseController
*/
public function lists(WebSettingServiceLogic $webSettingServiceLogic){
$lists = $webSettingServiceLogic->setting_service_list();
foreach ($lists as $k => $v){
if($v['type'] == self::TYPE_CODE){
$v['values_link'] = url('/b/image/' . $v['values']);
$lists[$k] = $v;
}
}
$this->response('success',Code::SUCCESS,$lists);
}
/**
... ...
... ... @@ -25,7 +25,7 @@ class FileController
public $config = '';
public $thr_path = '';
public $uploads = '';
public $request = '';
... ... @@ -33,7 +33,8 @@ class FileController
{
$this->request = request();
$this->config = config('filesystems.disks.upload');
$this->path = $this->config['root'].'/file/';
$this->uploads = config('uploads.default_file');
$this->path = $this->config['root'].$this->uploads['path'].'/';
}
/**
... ... @@ -43,7 +44,7 @@ class FileController
* @method :post
* @time :2023/5/9 9:15
*/
public function index($hash = ''){
public function index($hash = '',$type = 1){
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
header("HTTP/1.1 304 Not Modified");
exit;
... ... @@ -59,6 +60,7 @@ class FileController
}
$content = file_get_contents($path);
$header['Content-Length'] = $info['size'];
$header['Content-Type'] = 'video/'.$info['type'];
return response($content, 200, $header);
}
/**
... ... @@ -66,9 +68,9 @@ class FileController
*/
public function upload() {
$this->request->validate([
'image'=>['required'],
'file'=>['required'],
],[
'image.required'=>'图片必须填写',
'file.required'=>'必须填写',
]);
$files = $this->request->file('file');
if (empty($files)) {
... ... @@ -82,7 +84,7 @@ class FileController
}
}
/**
* @name :上传图片
* @name :上传
* @return void
* @author :liyuhang
* @method
... ... @@ -96,12 +98,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,
... ... @@ -111,7 +114,7 @@ class FileController
if ($rs === false) {
return $this->response('添加失败', Code::USER_ERROR);
}
return $hash;
return $this->response('资源',Code::SUCCESS,['file'=>$hash]);
}
/**
* 多文件上传
... ... @@ -133,12 +136,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,
... ... @@ -147,7 +151,7 @@ class FileController
$data[] = $hash;
}
$fileModel->insert($save_data);
return $data;
return $this->response('资源',Code::SUCCESS,['files'=>$data]);
}
/**
* @name 统一返回参数
... ... @@ -161,10 +165,46 @@ class FileController
$result = [
'msg' => $msg == ' ' ? $code->description : $msg,
'code' => $code->value,
'data' => $data,
'data' => $this->_extents($data),
];
$this->header['Content-Type'] = $type;
$response = response($result,$result_code,$this->header);
throw new HttpResponseException($response);
}
/**
* @param $data
* @name :返回参数处理
* @return array|string
* @author :liyuhang
* @method
*/
protected function _extents($data) {
if (empty($data) || !is_array($data)) {
return empty($data) ? is_array($data) ? [] : '' : $data;
}
foreach ($data as $k => $v) {
if (is_array($v)) {
$data[$k] = $this->_extents($v);
} else {
if (is_null($v)) {
$data[$k] = '';
continue;
}
switch ((string) $k) {
case 'file':
$data['file_link'] = url('/b/file_hash/' . $v .'/'.rand(100,999));
break;
case 'files':
$v = explode(',',$v);
foreach ($v as $k1=>$v1){
$data['files_link'][$k1] = url('/b/file_hash/' . $v1 . '/'.rand(100,999));
}
break;
}
}
}
return $data;
}
}
... ...
... ... @@ -6,6 +6,7 @@ use App\Enums\Common\Code;
use App\Http\Controllers\type;
use App\Http\Controllers\统一返回参数;
use App\Models\File\Image as ImageModel;
use App\Models\User\User as UserModel;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Storage;
... ... @@ -24,6 +25,8 @@ class ImageController
'Content-Description' => 'File Transfer',
],
];
const TYPE = 1;
public $path = '';
public $config = '';
... ... @@ -36,10 +39,11 @@ class ImageController
{
$this->request = request();
$this->config = config('filesystems.disks.upload');
$this->path = $this->config['root'];
$this->uploads = config('upload.default_image');
$this->path = $this->config['root'].$this->uploads['path'].'/';
}
public function index($hash = '', $w = 0 ,$h = 0){
public function index($hash = '',$type = self::TYPE, $w = 0 ,$h = 0 ){
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
header("HTTP/1.1 304 Not Modified");
exit;
... ... @@ -50,6 +54,7 @@ class ImageController
$this->response('指定图片不存在!', Code::USER_ERROR);
}
//查看缩略图是否存在
// $header['Content-Type'] = 'image/'.$info['type'];
$filename = $this->path . $info['hash'] . $w . '_' . $h;
if(is_file($filename)){
$last_modified_time = gmdate(time() + ((30 * 60 * 60 * 24))) . " GMT";
... ... @@ -78,7 +83,12 @@ class ImageController
$img_type = $info['type'];
$content = base64_encode($content);
$img_base64 = 'data:image/' . $img_type . ';base64,' . $content;
return response($img_base64, 200, $header);
if($type != self::TYPE){
header('Content-Type: image/' . $img_type);
echo base64_decode($content);
exit;
}
return response($img_base64,200,$header);
}
/**
... ... @@ -114,15 +124,16 @@ class ImageController
$imageModel = new ImageModel();
$image_hash = $imageModel->read(['hash'=>$hash]);
if($image_hash !== false){
return $hash;
return $this->response('图片资源',Code::SUCCESS,['image'=>$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,
... ... @@ -132,7 +143,7 @@ class ImageController
if ($rs === false) {
return $this->response('添加失败', Code::USER_ERROR);
}
return $hash;
return $this->response('图片资源',Code::SUCCESS,['image'=>$hash]);
}
/**
* 生成缩略图缓存
... ... @@ -154,6 +165,7 @@ class ImageController
* @return type
*/
private function multi($files) {
if (!is_array($files)) {
$files = [$files];
}
... ... @@ -168,21 +180,23 @@ 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.'/'.$res->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(),
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
'type'=>$file->getClientOriginalExtension(),
];
$data[] = $hash;
}
$imageModel->insert($save_data);
return $data;
return $this->response('图片资源',Code::SUCCESS,['image'=>$data]);
}
//下载
... ... @@ -202,10 +216,50 @@ class ImageController
$result = [
'msg' => $msg == ' ' ? $code->description : $msg,
'code' => $code->value,
'data' => $data,
'data' => $this->_extents($data),
];
$this->header['Content-Type'] = $type;
$response = response($result,$result_code,$this->header);
throw new HttpResponseException($response);
}
/**
* @param $data
* @name :返回参数处理
* @return array|string
* @author :liyuhang
* @method
*/
protected function _extents($data) {
if (empty($data) || !is_array($data)) {
return empty($data) ? is_array($data) ? [] : '' : $data;
}
foreach ($data as $k => $v) {
if (is_array($v)) {
$data[$k] = $this->_extents($v);
} else {
if (is_null($v)) {
$data[$k] = '';
continue;
}
//获取操作人
switch ((string) $k) {
case 'image':
$data['image_link'] = url('/b/image/' . $v);
break;
case 'images':
$v = explode(',',$v);
foreach ($v as $k1=>$v1){
$data['images_link'][$k1] = url('/b/image/' . $v1);
}
break;
case 'file':
$data['file_link'] = url('/b/file_hash/' . $v);
break;
}
}
}
return $data;
}
}
... ...
... ... @@ -17,6 +17,19 @@ class AyrReleaseLogic extends BaseLogic
}
/**
* @name :()release_info
* @author :lyh
* @method :post
* @time :2023/5/9 16:27
*/
public function release_info(){
$info = $this->model->read($this->param);
if($info === false){
$this->fail('error');
}
return $this->success($info);
}
/**
* @name :(发布社交写入数据库)release_add
* @author :lyh
* @method :post
... ... @@ -36,30 +49,111 @@ class AyrReleaseLogic extends BaseLogic
* @method :post
* @time :2023/5/9 10:02
*/
public function ayr_release_add(){
public function ayr_release_add($param){
$param = [
'post'=>$this->param['content'],
'platforms'=>$this->param['platforms']
'platforms'=>$this->param['platforms'],
'mediaUrls'=>$this->param['mediaUrls'],
];
return $this->success($param);
}
/**
* @name :(发布到推特)post_twitter
* @author :lyh
* @method :post
* @time :2023/5/9 13:42
*/
public function post_twitter($param){
$param['post'] = '描述';
$param['platforms'] = ['twitter'];
$param['twitterOptions'] = [
'thread'=> true,
'threadNumber'=> true,
'mediaUrls'=>[
//图片地址
],
];
return $this->success($param);
}
/**
* @name :(发布到youtube)post_facebook
* @author :lyh
* @method :post
* @time :2023/5/9 10:05
*/
public function post_facebook(){
return $this->success();
$param['post'] = '视频描述';
$param['platforms'] = ['facebook'];
$param['faceBookOptions'] = [
'reels'=> true,
'title'=>'Super title for the Reel'
];
return $this->success($param);
}
/**
* @name :(发布到youtube)post_youtube
* @name :(发布到fbg,)post_youtube
* @author :lyh
* @method :post
* @time :2023/5/9 10:22
* @TODO::只能发布一张图片和一张视频
*/
public function post_gmb(){
$param['post'] = '描述';
$param['platforms'] = ['gmb'];
$param['mediaUrls'] = [];//图片链接
$param['gmbOptions'] = [
//视屏设置
'isPhotoVideo' => true,
'category'=> 'cate',//分类
];
return $this->success($param);
}
/**
* @name :(发布到instagram)post_google
* @author :lyh
* @method :post
* @time :2023/5/9 11:54
*/
public function post_youtube(){
public function post_instagram(){
$param['post'] = '视频描述';
$param['platforms'] = ['instagram'];
$param['faceBookOptions'] = [
'reels'=> true,
'title'=>'Super title for the Reel'
];
return $this->success();
}
/**
* @name :(领英)post_linkedin
* @author :lyh
* @method :post
* @time :2023/5/9 11:56
*/
public function post_linkedin(){
return $this->success();
}
/**
* @name :(红迪网)post_reddit
* @author :lyh
* @method :post
* @time :2023/5/9 13:40
*/
public function post_reddit(){
return $this->success();
}
/**
* @name :(抖音)post_tiktok
* @author :lyh
* @method :post
* @time :2023/5/9 13:44
*/
public function post_tiktok(){
}
}
... ...
... ... @@ -56,6 +56,19 @@ class AyrShareLogic extends BaseLogic
}
/**
* @name :(更新)ayr_share_edit
* @author :lyh
* @method :post
* @time :2023/5/9 14:44
*/
public function ayr_share_edit($param){
$rs = $this->model->edit($param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
/**
* @name :(删除ayr数据并同步删除)
* @author :lyh
* @method :post
... ...
... ... @@ -40,8 +40,14 @@ class WebSettingFromLogic extends BaseLogic
try {
//删除以前的数据
$this->model->del(['project_id'=>$this->user['project_id']]);
foreach ($this->param['data'] as $k => $v){
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
$v['project_id'] = $this->user['project_id'];
$this->param['data'][$k] = $v;
}
//新增
$this->model->add_all($this->param['data']);
$this->model->insert($this->param['data']);
}catch (\Exception $e){
$this->fail('error');
}
... ...
... ... @@ -37,9 +37,11 @@ class WebSettingReceivingLogic extends BaseLogic
$this->model->del(['project_id'=>$this->user['project_id']]);
foreach ($this->param['data'] as $k => $v){
$v['project_id'] = $this->user['project_id'];
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
$this->param['data'][$k] = $v;
}
$this->model->add_all($this->param['data']);
$this->model->insert($this->param['data']);
}catch (\Exception $e){
$this->fail('error');
}
... ...
... ... @@ -36,17 +36,21 @@ class WebSettingServiceLogic extends BaseLogic
* @time :2023/5/4 11:10
*/
public function setting_service_save(){
DB::beginTransaction();
try {
$this->param['data'] = Common::uniqueMultiArray($this->param['data']);
//删除以前的数据
$this->model->del(['project_id'=>$this->user['project_id']]);
foreach ($this->param['data'] as $k => $v){
//查询数据是否在数组中存在
$v['project_id'] = $this->user['project_id'];
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
$this->param['data'][$k] = $v;
}
$this->model->add_all($this->param['data']);
$this->model->insert($this->param['data']);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('error');
}
return $this->success();
... ...
... ... @@ -51,8 +51,7 @@ class WebSettingTextLogic extends BaseLogic
*/
public function setting_text_save(){
$web_setting = new WebSetting();
$setting_info = $this->setting_read();
if(count($this->param['data']) > $setting_info['anchor_num']){
if(count($this->param['data']) > $this->param['anchor_num']){
$this->fail('超过最大设置限制');
}
DB::beginTransaction();
... ... @@ -66,10 +65,12 @@ class WebSettingTextLogic extends BaseLogic
$web_setting->edit($data,['project_id'=>$this->user['project_id']]);
$this->model->del(['project_id'=>$this->user['project_id']]);
foreach ($this->param['data'] as $k => $v){
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
$v['project_id'] = $this->user['project_id'];
$this->param['data'][$k] = $v;
}
$this->model->add_all($this->param['data']);
$this->model->insert($this->param['data']);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ...
... ... @@ -29,7 +29,7 @@ class LoginAuthMiddleware
if(empty($info)){
return response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']);
}
// 设置数据信息
// // 设置数据信息
// $project = ProjectServer::useProject($info['project_id']);
// if($project){
// return response(['code'=>Code::USER_ERROR,'msg'=>'数据库未配置']);
... ...
... ... @@ -15,5 +15,22 @@ class AyrShareRequest extends FormRequest
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name'=>'required||unique:gl_ayr_share,name',
];
}
public function messages()
{
return [
'name.required'=>'请填写名称',
];
}
}
... ...
... ... @@ -114,16 +114,6 @@ class Base extends Model
}
/**
* @name :(获取数据条数)count
* @author :lyh
* @method :post
* @time :2023/5/8 15:51
*/
public function get_count($condition){
$query = $this->formatQuery($condition);
$query->count();
}
/**
* @name :新增
* @return void
* @author :liyuhang
... ... @@ -136,20 +126,6 @@ class Base extends Model
}
/**
* @name :(批量插入)add_all
* @author :lyh
* @method :post
* @time :2023/5/8 17:41
*/
public function add_all($data){
foreach ($data as $k => $v){
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
$data[$k] = $v;
}
return $this->insert($data);
}
/**
* @name :编辑
* @return void
* @author :liyuhang
... ...
... ... @@ -68,7 +68,7 @@ return [
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE_TMP', 'gl_data_tmp'),
'database' => env('DB_DATABASE_TMP', 'gl_data_0_tmp'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
... ...
... ... @@ -14,12 +14,19 @@ return [
],
'path' => '/product'
],
//用户头像
'user' =>[
//默认
'default_image' =>[
'size' => [
'max' => 1024*1024*2, // 2M
],
'path' => '/user'
'path' => '/image'
],
//默认视频
'default_file' =>[
'size' => [
'max' => 1024*1024*200, // 2M
],
'path' => '/file'
],
//博客图
'blog' =>[
... ...
... ... @@ -211,7 +211,8 @@ Route::middleware(['bloginauth'])->group(function () {
//社交绑定
Route::prefix('ayr')->group(function () {
Route::any('/lists', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'lists'])->name('ayr_lists');
Route::any('/', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'lists'])->name('ayr_lists');
Route::any('/save', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'save_account'])->name('ayr_save_account');
Route::any('/create', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'create_account'])->name('ayr_create_account');
Route::any('/del', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'del_account'])->name('ayr_del_account');
Route::any('/bind', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'bind_account'])->name('ayr_bind_account');
... ...