作者 赵彬吉
... ... @@ -32,7 +32,7 @@ class SyncTimeFiles extends Command
public function handle()
{
$fileModel = new File();
$start = '2024-08-10 00:00:00';
$start = '2024-08-26 00:00:00';
$end = date('Y-m-d H:i:s');
$lists = $fileModel->list(['created_at'=>['between',[$start,$end]]]);
foreach ($lists as $v){
... ...
... ... @@ -55,13 +55,13 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>['in',[1535]]]);
$list = $projectModel->list(['id'=>['in',[1155]]]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
// $this->getProduct();
$this->setProductKeyword();
$this->getProduct();
// $this->setProductKeyword();
// $this->getBlog();
DB::disconnect('custom_mysql');
}
... ...
... ... @@ -386,6 +386,18 @@ class HtmlCollect extends Command
}
}
//特殊项目
if ($project_id == 2226) {
preg_match_all('/data-parallax-image=[\'"](.*?)[\'"]>/i', $html, $result_s);
$special = $result_s[1] ?? [];
foreach ($special as $v_s) {
$check_v_s = $this->url_check($v_s, $project_id, $domain, $web_url_domain, $home_url);
if ($check_v_s && (!in_array($check_v_s, $source))) {
$source[] = $check_v_s;
}
}
}
return $source;
}
... ...
... ... @@ -29,6 +29,7 @@ use App\Models\WebSetting\WebSettingReceiving;
use App\Services\CosService;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
... ... @@ -67,9 +68,14 @@ class ProjectUpdate extends Command
protected function start_update()
{
$task_id = $this->get_task();
if (!$task_id) {
if ($task_id === false) {
//所有任务执行完成
sleep(60);
return true;
} elseif ($task_id === 0) {
//队列任务已处理完,有进程正在查询数据库,等待5秒后执行
sleep(5);
return true;
}
$task = UpdateLog::where('id', $task_id)->where('status', UpdateLog::STATUS_UN)->first();
... ... @@ -711,6 +717,7 @@ class ProjectUpdate extends Command
$extend = $extend_model->read(['title' => $ke]);
if ($extend) {
if ($extend['type'] == 3) {
//图片
$gallery = [];
if (is_array($ve)) {
foreach ($ve as $ve_img) {
... ... @@ -721,8 +728,24 @@ class ProjectUpdate extends Command
}
$value = Arr::a2s($gallery);
} elseif ($extend['type'] == 4) {
//文件
if (is_array($ve)) {
if (isset($ve['title']) || isset($ve['url'])) {
$file = [
[
'name' => isset($ve['title']) ? $ve['title'] : '',
'url' => isset($ve['url']) ? $this->source_download($ve['url'], $project_id, $domain_arr['host'], $web_url_domain, $home_url, 1) : ''
]
];
} else {
$file = [];
}
$value = Arr::a2s($file);
} else {
$value = Arr::a2s([$this->source_download($ve, $project_id, $domain_arr['host'], $web_url_domain, $home_url, 1)]);
}
} else {
//文本
$value = $ve;
}
... ... @@ -777,6 +800,11 @@ class ProjectUpdate extends Command
return $task_id;
}
if (!Cache::add('console_update_task_select_mysql', true, 5)) {
//如果存在数据锁,表示有其他进程已往下执行,当前进程直接返回
return 0;
}
$task_list = UpdateLog::where('status', UpdateLog::STATUS_UN)->orderBy('sort', 'asc')->orderBy('updated_at', 'asc')->limit(20)->get();
if ($task_list->count() == 0) {
return false;
... ... @@ -793,7 +821,7 @@ class ProjectUpdate extends Command
//获取地址路由
protected function get_url_route($url)
{
if (strpos($url, '%3A') !== false || strpos($url, '%2F') !== false) {
if (strpos($url, '%') !== false) {
$url = urldecode($url);
}
$arr = parse_url($url);
... ...
... ... @@ -926,6 +926,28 @@ function base62_encode($num) {
return $result;
}
/**
* @remark :腾讯云安全的base64
* @name :urlSafeBase64Encode
* @author :lyh
* @method :post
* @time :2024/8/19 14:21
*/
function urlSafeBase64Encode($data = '') {
if(empty($data)){
return $data;
}
// 1. 使用标准的 BASE64 编码
$base64 = base64_encode($data);
// 2. 将加号(+)替换成连接号(-)
$base64 = str_replace('+', '-', $base64);
// 3. 将正斜线(/)替换成下划线(_)
$base64 = str_replace('/', '_', $base64);
// 4. 去掉末尾的等号(=)
$base64 = rtrim($base64, '=');
return $base64;
}
... ...
... ... @@ -30,7 +30,7 @@ class ProductController extends BaseController
public function getImages(Request $request)
{
$project_id = $request->input('project_id');
$project = ProjectServer::useProject($project_id);
$project = ProjectServer::useProject($project_id); $project = ProjectServer::useProject($project_id);
if (!$project) {
$this->response('项目不存在', Code::SYSTEM_ERROR);
}
... ...
<?php
namespace App\Http\Controllers\Aside\AutoPull;
use App\Enums\Common\Code;
use App\Helper\Arr;
use App\Http\Controllers\Aside\BaseController;
use App\Models\AutoPull\AutoPullNotify;
use App\Models\Manage\Manage;
class AutoPullController extends BaseController
{
/**
* 获取自动拉取代码任务列表
* @author Akun
* @date 2024/08/26 15:49
*/
public function getTaskLists()
{
$autoModule = new AutoPullNotify();
$lists = $autoModule->lists($this->map, $this->page, $this->row);
if (!empty($lists)) {
$manage_model = new Manage();
foreach ($lists['list'] as $k => $v) {
$lists['list'][$k]['operator_name'] = $manage_model->getName($v['user_id']);
$lists['list'][$k]['server_name'] = AutoPullNotify::serversMap()[$v['server_id']];
$process = Arr::s2a($v['process']);
$process_name = [];
if ($process) {
foreach ($process as $kp => $vp) {
$process_name[$kp] = AutoPullNotify::processMap()[$vp];
}
}
$lists['list'][$k]['process_name'] = $process_name;
}
}
$this->response('success', Code::SUCCESS, $lists);
}
/**
* 添加自动拉取代码任务
* @author Akun
* @date 2024/08/26 16:31
*/
public function saveTask()
{
$this->request->validate([
'server_id' => 'required',
], [
'server_id.required' => '服务器不能为空'
]);
$model = new AutoPullNotify();
foreach ($this->param['server_id'] as $v) {
$model->add([
'user_id' => $this->uid,
'server_id' => $v,
'process' => Arr::a2s($this->param['process'] ?? []),
'status' => 0
]);
}
$this->response('success');
}
/**
* 获取服务器及进程配置
* @author Akun
* @date 2024/08/26 16:07
*/
public function taskMap()
{
$servers = AutoPullNotify::serversMap();
$process = AutoPullNotify::processMap();
$lists = [
'servers' => $servers,
'process' => $process
];
$this->response('success', Code::SUCCESS, $lists);
}
}
... ...
... ... @@ -47,7 +47,8 @@ class ExtensionModuleController extends BaseController
'3'=>'图片框',
'4'=>'文件框',
'5'=>'下拉框',
'6'=>'自动生成订单框'
'6'=>'自动生成订单框',
'7'=>'创建时间'
];
$this->response('success',Code::SUCCESS,$data);
}
... ... @@ -66,7 +67,7 @@ class ExtensionModuleController extends BaseController
'module_id.required' => '模块id不能为空',
]);
$moduleFieldModel = new ExtensionModuleField();
$list = $moduleFieldModel->list(['module_id'=>$this->param['module_id']]);
$list = $moduleFieldModel->list(['module_id'=>$this->param['module_id']],'sort',['*'],'desc');
$moduleValueModel = new ExtensionModuleValue();
foreach ($list as $k => $v){
$v['is_use'] = 0;
... ... @@ -76,6 +77,9 @@ class ExtensionModuleController extends BaseController
$v['is_use'] = 1;
}
$list[$k] = $v;
if(!empty($v['data'])){
$v['data'] = json_decode($v['data'],true);
}
}
$this->response('success',Code::SUCCESS,$list);
}
... ... @@ -133,12 +137,25 @@ class ExtensionModuleController extends BaseController
],[
'module_id.required' => '模块id不能为空',
]);
$searchParam = [
'module_id'=>$this->param['module_id'],
];
$data = [];
$moduleValueModel = new ExtensionModuleValue();
$lists = $moduleValueModel->list(['module_id'=>$this->param['module_id']]);
if(isset($this->param['field_id']) && ($this->param['field_id'] != 0) && isset($this->param['value'])){
$uuidArr = $moduleValueModel->formatQuery(['field_id'=>$this->param['field_id'],'value'=>$this->param['value'],'module_id'=>$this->param['module_id']])->distinct()->pluck('uuid')->toArray();
if(!empty($uuidArr)){
$searchParam['uuid'] = ['in',$uuidArr];
}
}
if(isset($this->param['start_time']) && !empty($this->param['start_time']) && isset($this->param['end_time']) && !empty($this->param['end_time'])){
$searchParam['created_at'] = ['between',[$this->param['start_time'],$this->param['end_time']]];
}
$lists = $moduleValueModel->list($searchParam);
if(!empty($lists)){
foreach ($lists as $k => $v){
$data[$v['uuid']][$v['field_id']] = $v['value'];
$data[$v['uuid']]['created_at'] = $v['created_at'];
}
}
$resultData = [];
... ... @@ -224,7 +241,112 @@ class ExtensionModuleController extends BaseController
* @time :2024/8/20 10:31
*/
public function sendUniqueStr(){
$this->request->validate([
'id'=>'required',
],[
'id.required' => '字段id不能为空',
]);
$uniqueString = '';
//查看当前字段id的data
$moduleFieldModel = new ExtensionModuleField();
$info = $moduleFieldModel->read(['id'=>$this->param['id']]);
if(empty($info['data'])){
$uniqueString = md5(time() . rand(1000, 9999));
}else{
$data = json_decode($info['data']);
foreach ($data as $v){
foreach ($v as $k => $sonV){
if($k == 1){
$uniqueString .= $sonV;
}elseif ($k == 2){
$uniqueString .= date('YmdHis');
}elseif ($k == 3){
$uniqueString .= uniqid();
}else{
$randomString = md5(uniqid(mt_rand(), true));
$uniqueString .= substr($randomString, 0, (int)$sonV);
}
}
}
}
$this->response('success',Code::SUCCESS,['str'=>$uniqueString]);
}
/**
* @remark :获取类型
* @name :getFieldType
* @author :lyh
* @method :post
* @time :2024/8/22 11:22
*/
public function getFieldType(){
$data = [
1=>'文本框',
2=>'多文本框',
3=>'图片框',
4=>'文件框',
5=>'下拉框',
6=>'自动订单'
];
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :设置排序
* @name :setSort
* @author :lyh
* @method :post
* @time :2024/8/22 17:27
*/
public function setSort(){
$moduleFieldModel = new ExtensionModuleField();
$num = 100;
foreach ($this->param['id'] as $id){
$moduleFieldModel->edit(['sort'=>$num],['id'=>$id]);
$num--;
}
$this->response('success');
}
/**
* @remark :设置搜索参数
* @name :setSearchParam
* @author :lyh
* @method :post
* @time :2024/8/23 16:24
*/
public function setSearchParam(){
$this->request->validate([
'module_id'=>'required',
'id'=>'required|array'
],[
'module_id.required' => '模块id不能为空',
'id.required'=>'id不能为空',
'id.array'=>'id是一个数组'
]);
$moduleFieldModel = new ExtensionModuleField();
$moduleFieldModel->edit(['is_search'=>0],['module_id'=>$this->param['module_id']]);
$moduleFieldModel->edit(['is_search'=>1],['id'=>['in',$this->param['id']]]);
$this->response('success');
}
/**
* @remark :删除数据
* @name :delExtensionValue
* @author :lyh
* @method :post
* @time :2024/8/26 14:25
*/
public function delExtensionValue(){
$this->request->validate([
'module_id'=>'required',
'uuid'=>'required',
],[
'module_id.required' => '模块id不能为空',
'uuid.required' => '字段id不能为空',
]);
$moduleValueModel = new ExtensionModuleValue();
$moduleValueModel->del(['module_id'=>$this->param['module_id'],'uuid'=>$this->param['uuid']]);
$this->response('success');
}
}
... ...
... ... @@ -134,6 +134,9 @@ class InquiryController extends BaseController
}
foreach ($map as $field => $name) {
if(is_array($item[$field])){
$item[$field] = implode(',',$item[$field]);
}
if (Str::startsWith($item[$field], '=')) {
$item[$field] = "'" . $item[$field];
}
... ...
... ... @@ -17,6 +17,7 @@ use App\Models\Product\ExtendInfo;
use App\Models\Product\Keyword;
use App\Models\Product\KeywordRelated;
use App\Models\Product\Product;
use App\Models\Product\ProductType;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\Setting;
use App\Models\Template\BTemplate;
... ... @@ -665,4 +666,41 @@ class ProductController extends BaseController
$logic->delProductKeyword();
$this->response('success');
}
/**
* @remark :获取产品类型
* @name :getProductType
* @author :lyh
* @method :post
* @time :2024/8/21 17:18
*/
public function getProductType(){
$typeModel = new ProductType();
$data = $typeModel->list(['project_id'=>['in',[0,$this->user['project_id']]]]);
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存数据
* @name :saveType
* @author :lyh
* @method :post
* @time :2024/8/21 17:52
*/
public function saveType(){
$this->request->validate([
'name'=>'required',
],[
'name.required' => 'id不为空',
]);
$typeModel = new ProductType();
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$typeModel->edit($this->param,['id'=>$this->param['id']]);
}else{
$this->param['project_id'] = $this->user['project_id'];
$id = $typeModel->addReturnId($this->param);
}
$this->response('success',Code::SUCCESS,['id'=>$id]);
}
}
... ...
... ... @@ -147,7 +147,14 @@ class FileController
*/
public function synchronizationFile($fileName,$location){
//同步到大文件
$file_path = $this->getUrl($this->path.'/'.$fileName, 0,$location);
$headers = get_headers($file_path, 1);
if (strpos($headers[0], '200') === false) {
$errorFileModel = new ErrorFile();
$errorFileModel->add(['path'=>$this->param['path'].'/'.$this->param['name']]);
}else{
SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName,'location'=>$location]);
}
return true;
}
... ...
... ... @@ -10,10 +10,13 @@ use App\Jobs\CopyProjectJob;
use App\Jobs\SyncImageFileJob;
use App\Models\File\ErrorFile;
use App\Models\File\Image as ImageModel;
use App\Models\File\ImageSetting;
use App\Models\File\WatermarkImage;
use App\Models\Project\Project;
use App\Services\AmazonS3Service;
use App\Services\CosService;
use App\Services\TencentCosService;
use App\Services\UpyunService;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Cache;
... ... @@ -204,8 +207,9 @@ class ImageController extends Controller
$fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0);
//上传到cos
if($this->upload_location == 0){
$watermarkOptions = $this->getProjectConfig($this->cache['project_id'] ?? 0);
$cosService = new CosService();
$cosService->uploadFile($files,$this->path,$fileName);
$cosService->uploadFile($files,$this->path,$fileName,false,$watermarkOptions);
}else{
//TODO::上传亚马逊
$amazonS3Service = new AmazonS3Service();
... ... @@ -337,8 +341,9 @@ class ImageController extends Controller
$this->saveMysql($imageModel,$file->getSize(),$image_type,$fileName,$hash,$this->upload_location,$file->getMimeType(),$name);
//同步数据到cos
if($this->upload_location == 0){
$watermarkOptions = $this->getProjectConfig($this->cache['project_id'] ?? 0);
$cosService = new CosService();
$cosService->uploadFile($file,$this->path,$fileName);
$cosService->uploadFile($file,$this->path,$fileName,false,$watermarkOptions);
}else{
//TODO::上传亚马逊
$amazonS3Service = new AmazonS3Service();
... ... @@ -354,6 +359,54 @@ class ImageController extends Controller
}
/**
* @remark :获取图片配置
* @name :getProjectConfig
* @author :lyh
* @method :post
* @time :2024/8/24 11:03
*/
public function getProjectConfig($project_id = 0){
$str = '';
$imageSettingModel = new ImageSetting();
$settingInfo = $imageSettingModel->read(['project_id'=>$project_id]);
if($settingInfo !== false){
if($settingInfo['status'] == 1 && !empty($settingInfo['image_data'])){
$image_data = json_decode($settingInfo['image_data'],true);
foreach ($image_data as $k => $v){
if (str_starts_with($v, "image/")) {
$v = 'image/'.urlSafeBase64Encode(substr($v, strlen("image/")));
}
$image_data[$k] = $v;
}
$str = 'watermark/1/'.implode('/',$image_data);
return $str;
}
if($settingInfo['status'] == 2 && !empty($settingInfo['str_data'])){
$str_data = json_decode($settingInfo['str_data'],true);
foreach ($str_data as $k => $v){
$arr = explode('/',$v);
if ($arr[0] == 'text') {
$arr[1] = urlSafeBase64Encode($arr[1]);
$v = implode('/',$arr);
}
if ($arr[0] == 'font') {
$arr[1] = urlSafeBase64Encode($arr[1]);
$v = implode('/',$arr);
}
if ($arr[0] == 'fill') {
$arr[1] = urlSafeBase64Encode($arr[1]);
$v = implode('/',$arr);
}
$str_data[$k] = $v;
}
}
$str = 'watermark/2/'.implode('/',$str_data);
return $str;
}
return $str;
}
/**
* @param $filename
* @remark :下载
* @name :download
... ... @@ -514,4 +567,203 @@ class ImageController extends Controller
$data = ['image_download'=>url('a/download_images?path='.$info['path']), 'name' => $info['name']];
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :覆盖原图
* @name :coverOriginalImage
* @author :lyh
* @method :post
* @time :2024/8/21 11:45
*/
public function coverOriginalImage(){
$this->request->validate([
'old_url'=>['required'],
'url'=>['required'],
'saveUrl'=>['required'],
],[
'old_url.required'=>'原图的相对路径',
'url.required'=>'请填写预览的链接',
'saveUrl.required'=>'保存的路径',
]);
$cos = new CosService();
$url = $cos->coverOriginalImage($this->param['url'],$this->param['saveUrl']);
$this->saveWatermarkImage($this->param['saveUrl'],$this->param['old_url']);
if($this->param['saveUrl'] == $this->param['old_url']){
$upYun = new UpyunService();
$upYun->purgePush($url);
}
$this->response('success',Code::SUCCESS,['url'=>$url]);
}
/**
* @remark :设置图片水印
* @name :setWatermark
* @author :lyh
* @method :post
* @time :2024/8/21 9:15
*/
public function setWatermark(){
$this->request->validate([
'url'=>['required'],
'is_image'=>['required'],
],[
'url.required'=>'请填写需要处理图片的相对路径',
'is_image.required'=>'请设置文本水印还是图片水印',
]);
$cos = new CosService();
$url = $cos->setWatermark($this->param['url'], $this->param['data'],$this->param['is_image']);
$this->response('success',Code::SUCCESS,['url'=>$url]);
}
/**
* @remark :获取字体
* @name :getFont
* @author :lyh
* @method :post
* @time :2024/8/21 9:47
*/
public function getFont(){
$cos = new CosService();
$data = $cos->getFont();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :处理9宫格数据
* @name :getPosition
* @author :lyh
* @method :post
* @time :2024/8/21 9:47
*/
public function getPosition(){
$cos = new CosService();
$data = $cos->getPosition();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存水印图片记录
* @name :saveWatermarkImage
* @author :lyh
* @method :post
* @time :2024/8/21 14:34
*/
public function saveWatermarkImage($path,$old_path){
$watermarkImageModel = new WatermarkImage();
$data = [
'path' => $path,
'old_path'=>$old_path,
'project_id' =>$this->cache['project_id'] ?? 0
];
return $watermarkImageModel->addReturnId($data);
}
/**
* @remark :设置请求参数
* @name :setInputParam
* @author :lyh
* @method :post
* @time :2024/8/24 10:31
*/
public function saveInputParam(){
$this->request->validate([
'data'=>['required'],
'is_image'=>['required'],
],[
'data.required'=>'数据',
'is_image.required'=>'请设置文本水印还是图片水印',
]);
$data = $this->param['data'];
$is_image = $this->param['is_image'];
$imageSetting = new ImageSetting();
$info = $imageSetting->read(['project_id'=>$this->cache['project_id']]);
$domain = 'http://globalso-v6-1309677403.cos.ap-hongkong.myqcloud.com';//cos域名
if($is_image){
$param = [
'image/'.$domain.($data['image'] ?? ''),//图片
'gravity/'.($data['gravity'] ?? 'SouthEast'),
'dx/'.($data['dx'] ?? 0),
'dy/'. ($data['dy'] ?? 0),
'batch/'.($data['batch'] ?? 0),//平铺水印功能
'dissolve/'.($data['dissolve'] ?? 50),//透明度
'degree/'.($data['degree'] ?? 0),//旋转角度设置,取值范围为0 - 360,默认0
];
if($info === false){
$imageSetting->add(['image_data'=>json_encode($param,true),'project_id'=>$this->cache['project_id']]);
}else{
$imageSetting->edit(['image_data'=>json_encode($param,true)],['project_id'=>$this->cache['project_id']]);
}
}else{
$param = [
'text/'.($data['text'] ?? ''),//文字水印名称
'gravity/'.($data['gravity'] ?? 'SouthEast'),
'dx/'.($data['dx'] ?? 10),
'dy/'. ($data['dy'] ?? 10),
'font/'.($data['font'] ?? 'tahoma.ttf'),//默认宋体
'fontsize/'.($data['fontsize'] ?? 24),//水印文字字体大小,单位为磅,缺省值13
'fill/'.($data['fill'] ?? '#3D3D3D'),//颜色
'dissolve/'.($data['dissolve'] ?? 50),//透明度
'degree/'.($data['degree'] ?? 0),//文字水印的旋转角度设置,取值范围为0 - 360,默认0
'batch/'.($data['batch'] ?? 0),//平铺水印功能
'shadow/'.($data['shadow'] ?? 0),//文字阴影效果,有效值为[0,100],默认为0,表示无阴影
];
if($info === false){
$imageSetting->add(['str_data'=>json_encode($param,true),'project_id'=>$this->cache['project_id']]);
}else{
$imageSetting->edit(['str_data'=>json_encode($param,true)],['project_id'=>$this->cache['project_id']]);
}
}
$this->response('success');
}
/**
* @remark :修改水印配置状态
* @name :editStatus
* @author :lyh
* @method :post
* @time :2024/8/24 11:14
*/
public function editStatus(){
$this->request->validate([
'status'=>'required',
],[
'status.required'=>'状态',
]);
$imageSetting = new ImageSetting();
$info = $imageSetting->read(['project_id'=>$this->cache['project_id']]);
if($info === false){
$this->response('请先设置水印',Code::SYSTEM_ERROR);
}
if($info['status'] == 1 && empty($info['image_data'])){
$this->response('请先设置水印',Code::SYSTEM_ERROR);
}
if($info['status'] == 2 && empty($info['str_data'])){
$this->response('请先设置水印',Code::SYSTEM_ERROR);
}
$imageSetting->edit(['status'=>$this->param['status']],['project_id'=>$this->cache['project_id']]);
$this->response('success');
}
/**
* @remark :获取配置
* @name :getImageSetting
* @author :lyh
* @method :post
* @time :2024/8/24 11:41
*/
public function getImageSetting(){
$imageSetting = new ImageSetting();
$info = $imageSetting->read(['project_id'=>$this->cache['project_id']]);
if($info !== false){
if(!empty($info['image_data'])){
$info['image_data'] = json_decode($info['image_data'],true);
}
if(!empty($info['str_data'])){
$info['str_data'] = json_decode($info['str_data'],true);
}
$info['domain'] = 'http://globalso-v6-1309677403.cos.ap-hongkong.myqcloud.com';
}
$this->response('success',Code::SUCCESS,$info);
}
}
... ...
... ... @@ -114,7 +114,7 @@ class BTemplateLogic extends BaseLogic
$condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>'','is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id];
$headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id);
$bTemplateComModel = new BTemplateCom();
$otherInfo = $bTemplateComModel->read(['source'=>$headComInfo['source'],'common_type'=>BTemplate::COMMON_OTHER,'is_list'=>$headComInfo['is_list'],'is_custom'=>$headComInfo['is_custom']]);
$otherInfo = $bTemplateComModel->read(['source'=>$headComInfo['source'],'common_type'=>BTemplate::COMMON_OTHER,'is_list'=>$headComInfo['is_list'],'is_custom'=>$headComInfo['is_custom'],'template_id'=>$template_id]);
if($otherInfo === false){
$this->fail('获取失败,请联系管理员222');
}
... ... @@ -139,7 +139,7 @@ class BTemplateLogic extends BaseLogic
$headComInfo = $bTemplateComModel->read($condition);
if($headComInfo === false){
//取默认公共的
$headComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_HEAD]);
$headComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_HEAD,'template_id'=>$template_id]);
if($headComInfo === false){
$this->fail('获取失败,请联系管理员111');
}
... ... @@ -160,7 +160,7 @@ class BTemplateLogic extends BaseLogic
$footerComInfo = $bTemplateComModel->read($condition);
if($footerComInfo === false){
//取默认首页的
$footerComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_FOOTER]);
$footerComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_FOOTER,'template_id'=>$template_id]);
if($footerComInfo === false){
$this->fail('获取失败,请联系管理员');
}
... ...
... ... @@ -51,33 +51,50 @@ class CustomTemplateLogic extends BaseLogic
$this->fail('当前数据不存在');
}
if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){
$html = $this->getTemplateComHtml($info['html'],$info['html_style']);
$template_id = $this->getTemplateId();
$html = $this->getTemplateComHtml($info['html'],$info['html_style'],$template_id);
$info['html'] = $this->getHeadFooter($html);
}
return $this->success($info);
}
/**
* @remark :获取模版id
* @name :getTemplateId
* @author :lyh
* @method :post
* @time :2023/12/27 10:51
*/
public function getTemplateId(){
$bSettingModel = new Setting();
$bSettingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']],['id','template_id']);
if($bSettingInfo === false){
$this->fail('请先设置模板');
}
return $this->success($bSettingInfo['template_id']);
}
/**
* @remark :非定制获取头部+底部
* @name :getTemplateComHtml
* @author :lyh
* @method :post
* @time :2024/4/29 16:53
*/
public function getTemplateComHtml($html,$html_style){
public function getTemplateComHtml($html,$html_style,$template_id){
if(empty($html)){
$html = "<main></main>";
$html_style = "<style id='globalsojs-styles'></style>";
}
$headComInfo = $this->getHeadComHtml(['common_type'=>BTemplate::COMMON_HEAD]);
$headComInfo = $this->getHeadComHtml(['common_type'=>BTemplate::COMMON_HEAD,'template_id'=>$template_id]);
$bTemplateComModel = new BTemplateCom();
$condition['common_type'] = BTemplate::COMMON_OTHER;
$condition['source'] = $headComInfo['source'];
$condition['template_id'] = $template_id;
$otherInfo = $bTemplateComModel->read($condition);
if($otherInfo === false){
$this->fail('获取失败,请联系管理员');
}
$footerComInfo = $this->getFooterComHtml();
$footerComInfo = $this->getFooterComHtml($template_id);
$commonInfo = ['head_html'=>$headComInfo['html'] ?? '', 'head_style'=>$headComInfo['html_style'] ?? '', 'other'=>$otherInfo['html'] ?? '',
'footer_html'=>$footerComInfo['html'] ?? '','footer_style'=>$footerComInfo['html_style'] ?? ''];
$html = $commonInfo['head_style'].$html_style.$commonInfo['footer_style'].$commonInfo['other']. $commonInfo['head_html'].$html.$commonInfo['footer_html'];
... ... @@ -98,6 +115,7 @@ class CustomTemplateLogic extends BaseLogic
$headComInfo = $bTemplateComModel->read($condition);
if($headComInfo === false){
//取默认公共的
$template_id = $this->getTemplateId();
$condition['source'] = BTemplate::SOURCE_COM;
$headComInfo = $bTemplateComModel->read($condition);
if($headComInfo === false){
... ... @@ -113,12 +131,14 @@ class CustomTemplateLogic extends BaseLogic
* @method :post
* @time :2024/4/29 17:18
*/
public function getFooterComHtml(){
public function getFooterComHtml($template_id){
$bTemplateComModel = new BTemplateCom();
$condition['template_id'] = $template_id;
$condition['common_type'] = BTemplate::COMMON_FOOTER;
$condition['source'] = $this->getType(BTemplate::COMMON_FOOTER);
$footerComInfo = $bTemplateComModel->read($condition);
if($footerComInfo === false){
$template_id = $this->getTemplateId();
//取默认首页的
$condition['source'] = BTemplate::SOURCE_COM;
$footerComInfo = $bTemplateComModel->read($condition);
... ...
... ... @@ -57,6 +57,7 @@ class InitHtmlLogic extends BaseLogic
$html = $commonInfo['head_style'].$main_style.$commonInfo['footer_style'].$commonInfo['other'].$commonInfo['head_html'].$main_html.$commonInfo['footer_html'];
$html = $this->getHeadFooter($html);//组装数据
$data['html'] = $html;
$data['template_id'] = $template_id;
return $this->success($data);
}
... ... @@ -71,7 +72,7 @@ class InitHtmlLogic extends BaseLogic
$condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>$source,'is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id];
$headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id);
$bTemplateComModel = new BTemplateCom();
$otherInfo = $bTemplateComModel->read(['source'=>$headComInfo['source'],'common_type'=>BTemplate::COMMON_OTHER,'is_list'=>$headComInfo['is_list'],'is_custom'=>$headComInfo['is_custom']]);
$otherInfo = $bTemplateComModel->read(['template_id'=>$template_id,'source'=>$headComInfo['source'],'common_type'=>BTemplate::COMMON_OTHER,'is_list'=>$headComInfo['is_list'],'is_custom'=>$headComInfo['is_custom']]);
if($otherInfo === false){
$this->fail('获取失败,请联系管理员2');
}
... ... @@ -96,7 +97,7 @@ class InitHtmlLogic extends BaseLogic
$headComInfo = $bTemplateComModel->read($condition);
if($headComInfo === false){
//取默认公共的
$headComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_HEAD]);
$headComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_HEAD,'template_id'=>$template_id]);
if($headComInfo === false){
$this->fail('获取失败,请联系管理员1');
}
... ... @@ -117,7 +118,7 @@ class InitHtmlLogic extends BaseLogic
$footerComInfo = $bTemplateComModel->read($condition);
if($footerComInfo === false){
//取默认首页的
$footerComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_FOOTER]);
$footerComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_FOOTER,'template_id'=>$template_id]);
if($footerComInfo === false){
$this->fail('获取失败,请联系管理员3');
}
... ...
... ... @@ -94,7 +94,8 @@ class CustomModuleContentLogic extends BaseLogic
}elseif($v['type'] == 4){
$arr1 = json_decode($info['values']);
foreach ($arr1 as $k1=>$v1){
$v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0);
$v1 = (array)$v1;
$v1['url'] = getFileUrl($v1['url'] ?? $v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0);
$arr1[$k1] = $v1;
}
$v['values'] = $arr1;
... ... @@ -149,6 +150,11 @@ class CustomModuleContentLogic extends BaseLogic
* @time :2023/12/7 15:04
*/
public function contentAdd(){
//验证当前name是否已添加
$info = $this->model->read(['name'=>$this->param['name'],'module_id'=>$this->param['module_id']]);
if($info !== false){
$this->fail('当前数据名称已存在');
}
try {
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
... ... @@ -301,7 +307,7 @@ class CustomModuleContentLogic extends BaseLogic
$v['values'] = json_encode($v['values']);
}elseif ($v['type'] == 4){
foreach ($v['values'] as $k1=>$v1){
$v1 = str_replace_url($v1);
$v1['url'] = str_replace_url($v1['url']);
$v['values'][$k1] = $v1;
}
$v['values'] = json_encode($v['values']);
... ...
... ... @@ -39,6 +39,9 @@ class ExtensionModuleFieldLogic extends BaseLogic
if($info !== false){
$this->fail('当前字段名已存在');
}
if(isset($this->param['data']) && !empty($this->param['data'])){
$this->param['data'] = json_encode($this->param['data']);
}
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
... ... @@ -59,11 +62,11 @@ class ExtensionModuleFieldLogic extends BaseLogic
public function delModuleField(){
//查看当前字段是否在使用
$moduleValueModel = new ExtensionModuleValue();
$info = $moduleValueModel->read(['filed_id'=>$this->param['filed_id']]);
$info = $moduleValueModel->read(['field_id'=>$this->param['field_id']]);
if($info !== false){
$this->fail('当前字段正在使用中,不允许删除');
}
$this->model->del(['id'=>$this->param['filed_id']]);
$this->model->del(['id'=>$this->param['field_id']]);
return $this->success();
}
}
... ...
... ... @@ -178,6 +178,7 @@ class UserLoginLogic
$info['uptime'] = $project['uptime'];
$info['storage_type'] = $project['storage_type'];
$info['project_location'] = $project['project_location'];
$info['open_export_product'] = $project['open_export_product'];
$info['is_update_language'] = $project['is_update_language'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['file_cdn'] = $project['deploy_build']['file_cdn'];
... ... @@ -286,6 +287,7 @@ class UserLoginLogic
$info['configuration'] = $project['deploy_build']['configuration'];
$info['project_type'] = $project['type'];
$info['storage_type'] = $project['storage_type'];
$info['open_export_product'] = $project['open_export_product'];
$info['project_location'] = $project['project_location'];
$info['file_cdn'] = $project['deploy_build']['file_cdn'];
$info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0;
... ...
<?php
namespace App\Models\AutoPull;
use App\Models\Base;
class AutoPullNotify extends Base
{
protected $table = 'gl_auto_pull_notify';
public static function serversMap()
{
return [
1 => '硅谷云服务器',
9 => '硅谷IDC服务器01(6.0美服1)',
3 => '硅谷IDC服务器02(6.0美服2)',
2 => '俄罗斯服务器',
4 => '阿里云深圳服务器',
5 => '日本服务器',
8 => '香港服务器',
];
}
public static function processMap()
{
return [
'php artisan handle_html' => '拉取页面zip文件并解压',
'php artisan create_update_page_route' => '创建主站路由',
'php artisan create_update_page_master' => '生成主站页面',
'php artisan create_update_page_minor' => '生成小语种页面',
'php artisan create_update_page_now' => '实时生成主站页面',
'php artisan create_update_page_sitemap' => '生成主站sitemap,robots',
'php artisan create_update_amp_route' => '创建amp站路由',
'php artisan create_update_page_amp' => '生成amp站页面',
'php artisan create_update_amp_sitemap' => '生成amp站sitemap,robots',
];
}
}
... ...
<?php
/**
* @remark :
* @name :ImageSetting.php
* @author :lyh
* @method :post
* @time :2024/8/24 10:07
*/
namespace App\Models\File;
use App\Models\Base;
class ImageSetting extends Base
{
protected $table = 'gl_image_setting';
}
... ...
<?php
/**
* @remark :
* @name :WatermarkImage.php
* @author :lyh
* @method :post
* @time :2024/8/21 14:29
*/
namespace App\Models\File;
use App\Models\Base;
class WatermarkImage extends Base
{
protected $table = 'gl_watermark_image';
}
... ...
<?php
/**
* @remark :
* @name :ProductType.php
* @author :lyh
* @method :post
* @time :2024/8/21 16:46
*/
namespace App\Models\Product;
use App\Models\Base;
class ProductType extends Base
{
protected $table = 'gl_product_type';
}
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Services;
use App\Exceptions\InquiryFilterException;
use App\Models\File\ImageSetting;
use App\Utils\LogUtils;
use Qcloud\Cos\Client;
/**
... ... @@ -22,7 +23,7 @@ class CosService
* @method :post
* @time :2023/7/19 15:28
*/
public function uploadFile(&$files,$path,$filename, $binary = false,$watermarkOptions = null)
public function uploadFile(&$files,$path,$filename, $binary = false,$watermarkOptions = '')
{
$cos = config('filesystems.disks.cos');
$cosClient = new Client([
... ... @@ -41,18 +42,18 @@ class CosService
];
//水印
if ($watermarkOptions) {
$options['Pic-Operations'] = json_encode([
$options['PicOperations'] = json_encode([
'is_pic_info' => 1,
'rules' => [
[
'fileid' => $filename, // 使用相同的文件名保存
'fileid' => $key, // 使用相同的文件名保存
'rule' => $watermarkOptions,
]
]
]);
], true);
}
// 上传文件
$cosClient->putObject($options);
$res = $cosClient->putObject($options);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($res, true) . PHP_EOL, FILE_APPEND);
return $key;
}
... ... @@ -182,29 +183,29 @@ class CosService
South:底部中间
SouthEast:右下角
*/
public function addFieldImage($cdnUrl = '',$data = [],$is_image = false){
public function setWatermark($cdnUrl = '',$data = [],$is_image = false){
$domain = 'http://globalso-v6-1309677403.cos.ap-hongkong.myqcloud.com';//cos域名
$url = $domain . $cdnUrl;
if($is_image){
$param = [
'image/'.$this->urlSafeBase64Encode($domain.$data['image'] ?? ''),//文字水印名称
'image/'.urlSafeBase64Encode($domain.$data['image'] ?? ''),//图片
'gravity/'.($data['gravity'] ?? 'SouthEast'),
'dx/'.($data['dx'] ?? 0),
'dy/'. ($data['dy'] ?? 0),
'batch/'.($data['batch'] ?? 0),//平铺水印功能
'dissolve/'.($data['dissolve'] ?? 50),//透明度
'degree/'.($data['degree'] ?? 0),//文字水印的旋转角度设置,取值范围为0 - 360,默认0
'degree/'.($data['degree'] ?? 0),//旋转角度设置,取值范围为0 - 360,默认0
];
$url = $url.'?watermark/1/'.implode('/',$param);
}else{
$param = [
'text/'.$this->urlSafeBase64Encode($data['text'] ?? ''),//文字水印名称
'text/'.urlSafeBase64Encode($data['text'] ?? ''),//文字水印名称
'gravity/'.($data['gravity'] ?? 'SouthEast'),
'dx/'.($data['dx'] ?? 10),
'dy/'. ($data['dy'] ?? 10),
'font/'.$this->urlSafeBase64Encode($data['font'] ?? 'tahoma.ttf'),//默认宋体
'font/'.urlSafeBase64Encode($data['font'] ?? 'tahoma.ttf'),//默认宋体
'fontsize/'.($data['fontsize'] ?? 24),//水印文字字体大小,单位为磅,缺省值13
'fill/'.$this->urlSafeBase64Encode($data['fill'] ?? '#3D3D3D'),//颜色
'fill/'.urlSafeBase64Encode($data['fill'] ?? '#3D3D3D'),//颜色
'dissolve/'.($data['dissolve'] ?? 50),//透明度
'degree/'.($data['degree'] ?? 0),//文字水印的旋转角度设置,取值范围为0 - 360,默认0
'batch/'.($data['batch'] ?? 0),//平铺水印功能
... ... @@ -215,14 +216,16 @@ class CosService
return $url;
}
/**
* @remark :添加水印后保存图片(覆盖)
* @remark :添加水印后保存图片(覆盖/非覆盖的文件未存入数据库
* @name :uploadImages
* @author :lyh
* @method :post
* @time :2024/8/19 17:06
*/
public function uploadImages($url,$cdnUrl){
public function coverOriginalImage($url,$cdnUrl){
// 获取水印后的图片内容
$imageContent = file_get_contents($url);
// 使用 COS SDK 将图片重新上传并覆盖原图
... ... @@ -244,28 +247,6 @@ class CosService
}
/**
* @remark :腾讯云安全的base64
* @name :urlSafeBase64Encode
* @author :lyh
* @method :post
* @time :2024/8/19 14:21
*/
public function urlSafeBase64Encode($data = '') {
if(empty($data)){
return $data;
}
// 1. 使用标准的 BASE64 编码
$base64 = base64_encode($data);
// 2. 将加号(+)替换成连接号(-)
$base64 = str_replace('+', '-', $base64);
// 3. 将正斜线(/)替换成下划线(_)
$base64 = str_replace('/', '_', $base64);
// 4. 去掉末尾的等号(=)
$base64 = rtrim($base64, '=');
return $base64;
}
/**
* @remark :处理9宫格数据
* @name :getPosition
* @author :lyh
... ... @@ -274,15 +255,15 @@ class CosService
*/
public function getPosition(){
return [
1=>'gravity/northWest',
2=>'gravity/north',
3=>'gravity/northEast',
4=>'gravity/west',
5=>'gravity/center',
6=>'gravity/east',
7=>'gravity/southWest',
8=>'gravity/south',
9=>'gravity/southEast',
1=>'northWest',
2=>'north',
3=>'northEast',
4=>'west',
5=>'center',
6=>'east',
7=>'southWest',
8=>'south',
9=>'southEast',
];
}
... ...
<?php
/**
* Created by PhpStorm.
* User: zhl
* Date: 2024/8/20
* Time: 11:01
*/
namespace App\Services;
class UpyunService
{
/**
* 刷新进度查询
* @param $task_id
* @return mixed
*/
public function purgePull($task_id)
{
$action = '/purge';
if (FALSE == is_array($task_id))
$task_id = [$task_id];
$task_ids = implode(',', $task_id);
$param = [
'task_ids' => $task_ids, // 需要查询进度的 task_id
];
list($status, $result) = $this->curlRequest($action, $param, 'GET', $this->getHeader());
return $result;
}
/**
* URL 刷新
* @param $url
* @return mixed
*/
public function purgePush($url)
{
$action = '/purge';
if (FALSE == is_array($url))
$url = [$url];
$urls = implode(PHP_EOL, $url);
$param = [
'bucket' => '',
'urls' => $urls, // 需要批量刷新的文件 URL,多个 URL 通过换行符分隔
];
list($status, $result) = $this->curlRequest($action, $param, 'POST', $this->getHeader());
return $result;
}
/**
* URL 预热
* @param $url
* @return mixed
*/
public function preheatPush($url)
{
$action = '/preheat';
if (FALSE == is_array($url))
$url = [$url];
$urls = implode(PHP_EOL, $url);
$param = [
'bucket' => '',
'urls' => $urls, // 需要批量刷新的文件 URL,多个 URL 通过换行符分隔
'range_bytes' => ''
];
list($status, $result) = $this->curlRequest($action, $param, 'POST', $this->getHeader());
return $result;
}
/**
* 头信息需要携带授权token
* @return array
*/
public function getHeader()
{
return [
'Authorization: Bearer ' . config('custom.upyun.token'),
];
}
/**
* @param $url
* @param $data
* @param string $method
* @param array $header
* @param int $time_out
* @return array
*/
public function curlRequest($url, $data, $method = 'POST', $header = [], $time_out = 60)
{
$url = config('custom.upyun.api_url') . $url;
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, $time_out);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
if ($data)
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array_merge([
'Expect:',
'Content-type: application/json',
'Accept: application/json',
], $header)
);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return [$code, $response];
}
/**
* 创建token
* 该功能请不要重复使用
* 注意:出于安全考虑,token 只有在调用该接口创建时返回一次,后续无法再通过其他接口查询token值,调用该接口后,请务必记录token值
* {"access_token":"fe64817b-1f32-46f3-9ac3-a2993725708a","name":"v6-66c4333f60644","scope":"global","services":[],"created_at":1724134209,"expired_at":9999999999}
* @return mixed
*/
public function createToken()
{
$action = '/oauth/tokens';
$param = [
'username' => '', // 用户名
'password' => '', // 密码
'code' => md5(uniqid()), // 20-32位随机字符串,每次请求不能重复。只能包含数字、字母和中划线
'name' => 'v6-' . uniqid(), // token 备注名,长度 20 的字符串,不能和其他 token 重复
'scope' => 'global', // 权限 Valid Values:'global''bucket''operator''domain''cache''log''stats''oauth''security''srs'
// 'expired_at' => '', // integer token 过期时间的秒级时间戳,当该参数不设置时,表示永不过期
];
list($status, $result) = $this->curlRequest($action, $param);
return $result;
}
}
\ No newline at end of file
... ...
... ... @@ -24,5 +24,10 @@ return [
["69.172.229.12","69.172.229.13","69.172.229.14","69.172.229.15","69.172.229.16","69.172.229.36","69.172.229.59","69.172.229.60","69.172.229.61","69.172.229.62","69.172.229.63","69.172.229.64","69.172.229.65"],
["69.172.233.75","69.172.233.76","69.172.233.77","69.172.233.78","69.172.233.79","69.172.233.80","69.172.233.81","69.172.233.82","69.172.233.83","69.172.233.84","69.172.233.85","69.172.233.86","69.172.233.87"],
["76.74.220.18","76.74.220.19","76.74.220.20","76.74.220.21","76.74.220.22","76.74.220.23","76.74.220.24","76.74.220.25","76.74.220.26","76.74.220.27","76.74.220.28","76.74.220.29","76.74.220.30"],
["64.34.205.152","64.34.205.170","64.34.205.171","64.34.205.172","64.34.205.173","64.34.205.174","64.34.205.210","64.34.205.211","64.34.205.212","64.34.205.213","64.34.205.214","64.34.205.215","64.34.205.216"]]
["64.34.205.152","64.34.205.170","64.34.205.171","64.34.205.172","64.34.205.173","64.34.205.174","64.34.205.210","64.34.205.211","64.34.205.212","64.34.205.213","64.34.205.214","64.34.205.215","64.34.205.216"]],
'upyun' => [
'api_url' => 'https://api.upyun.com',
'token' => 'fe64817b-1f32-46f3-9ac3-a2993725708a',
],
];
... ...
... ... @@ -253,6 +253,8 @@ Route::middleware(['aloginauth'])->group(function () {
//图片操作
Route::prefix('images')->group(function () {
Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('images_upload');
Route::post('/getFont', [\App\Http\Controllers\File\ImageController::class, 'getFont'])->name('images_getFont');
Route::post('/getPosition', [\App\Http\Controllers\File\ImageController::class, 'getPosition'])->name('images_getPosition');
Route::post('/getDownloadUrl', [\App\Http\Controllers\File\ImageController::class, 'getDownloadUrl'])->name('images_getDownloadUrl');
});
//文件操作
... ... @@ -463,6 +465,14 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/saveModule', [Aside\ExtentModule\ExtensionModuleController::class, 'saveModule'])->name('admin.extension_module_saveModule');
Route::any('/delModule', [Aside\ExtentModule\ExtensionModuleController::class, 'delModule'])->name('admin.extension_module_delModule');
});
/**
* C端代码自动拉取模块
*/
Route::prefix('auto_pull')->group(function () {
Route::any('/', [Aside\AutoPull\AutoPullController::class, 'getTaskLists'])->name('admin.auto_pull_getTaskLists');
Route::any('/saveTask', [Aside\AutoPull\AutoPullController::class, 'saveTask'])->name('admin.auto_pull_saveTask');
Route::any('/taskMap', [Aside\AutoPull\AutoPullController::class, 'taskMap'])->name('admin.auto_pull_taskMap');
});
});
//无需登录验证的路由组
... ...
... ... @@ -257,6 +257,8 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/sendAiProduct', [\App\Http\Controllers\Bside\Product\ProductController::class, 'sendAiProduct'])->name('product_sendAiProduct');
Route::any('/getSearchCategoryList', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getSearchCategoryList'])->name('product_getSearchCategoryList');
Route::any('/delProductKeyword', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delProductKeyword'])->name('product_delProductKeyword');
Route::any('/getProductType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getProductType'])->name('product_getProductType');
Route::any('/saveType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'saveType'])->name('product_saveType');
//产品分类
Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category');
Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info');
... ... @@ -316,7 +318,14 @@ Route::middleware(['bloginauth'])->group(function () {
//图片操作
Route::prefix('images')->group(function () {
Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('image_upload');
Route::post('/getFont', [\App\Http\Controllers\File\ImageController::class, 'getFont'])->name('images_getFont');
Route::post('/getPosition', [\App\Http\Controllers\File\ImageController::class, 'getPosition'])->name('images_getPosition');
Route::post('/setWatermark', [\App\Http\Controllers\File\ImageController::class, 'setWatermark'])->name('images_setWatermark');
Route::post('/coverOriginalImage', [\App\Http\Controllers\File\ImageController::class, 'coverOriginalImage'])->name('images_coverOriginalImage');
Route::any('/getImageList', [\App\Http\Controllers\File\ImageController::class, 'getImageList'])->name('image_getImageList');
Route::any('/saveInputParam', [\App\Http\Controllers\File\ImageController::class, 'saveInputParam'])->name('image_saveInputParam');
Route::any('/editStatus', [\App\Http\Controllers\File\ImageController::class, 'editStatus'])->name('image_editStatus');
Route::any('/getImageSetting', [\App\Http\Controllers\File\ImageController::class, 'getImageSetting'])->name('image_getImageSetting');
});
//文件操作
Route::prefix('files')->group(function () {
... ... @@ -578,6 +587,10 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/addModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'addModuleValue'])->name('extension_module_addModuleValue');
Route::any('/editModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'editModuleValue'])->name('extension_module_editModuleValue');
Route::any('/sendUniqueStr', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'sendUniqueStr'])->name('extension_module_sendUniqueStr');
Route::any('/getFieldType', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'getFieldType'])->name('extension_module_getFieldType');
Route::any('/setSort', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'setSort'])->name('extension_module_setSort');
Route::any('/setSearchParam', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'setSearchParam'])->name('extension_module_setSearchParam');
Route::any('/delExtensionValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'delExtensionValue'])->name('extension_module_delExtensionValue');
});
//自定义小语种文本信息
... ...