作者 赵彬吉

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

... ... @@ -435,9 +435,9 @@ if (!function_exists('getImageUrl')) {
if($info['is_cos'] == 1){
$cos = config('filesystems.disks.cos');
$cosCdn = $cos['cdn'];
$url = $cosCdn.'/upload'.$info['path'];
$url = $cosCdn.$info['path'];
}else{
$url = url('upload'.$info['path']);
$url = url($info['path']);
}
}else{
$url = $hash;
... ... @@ -526,7 +526,7 @@ if (!function_exists('str_replace_url')) {
$urlParts = parse_url($url);
// 检查是否存在 host(域名)部分
if (isset($urlParts['path'])) {
$urlWithoutDomain = str_replace('/upload', '', $urlParts['path']);
$urlWithoutDomain = $urlParts['path'];
return $urlWithoutDomain;
} else {
return $url;
... ...
... ... @@ -12,15 +12,12 @@ namespace App\Http\Controllers\Bside;
use App\Enums\Common\Code;
use App\Events\WebSocketMessage;
use App\Events\WebSocketMessageSent;
use App\Helper\Arr;
use App\Helper\Common;
use App\Helper\Socket;
use App\Helper\Translate;
use App\Helper\Wechat;
use App\Http\Logic\Bside\User\UserLogic;
use App\Http\Logic\Bside\User\UserLoginLogic;
use App\Models\File\Image;
use App\Models\Project\Project;
use App\Models\File\Image as ImageModel;
use App\Models\Service\Service;
use App\Models\Sms\SmsLog;
use App\Models\Template\Template;
... ... @@ -283,11 +280,27 @@ class LoginController extends BaseController
}else{
$data = [
'code'=>0,
'message'=>'关注成功,请登录后绑定账号后扫码',
'message'=>'关注成功,请登录后绑定账号后扫码,如已绑定,请再次扫码',
];
}
return $data;
}
public function ceshi(){
$templateModel = new TemplateModule();
$list = $templateModel->list();
$imageModel = new ImageModel();
foreach ($list as $k=>$v){
if (strpos($v['image'], '.') !== false) {
$v['image'] = '/upload'.$v['image'];
}else{
$info = $imageModel->read(['hash'=>$v['image']]);
if($info !== false){
$v['image'] = $info['path'];
}
}
$templateModel->edit(['image'=>$v['image']],['id'=>$v['id']]);
}
$this->response('success');
}
}
... ...
... ... @@ -222,7 +222,7 @@ class FileController
*/
public function downLoad(){
$file_model = new File();
$info = $file_model->read(['hash' => $this->param['hash']]);
$info = $file_model->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
... ... @@ -314,11 +314,11 @@ class FileController
*/
public function getDownloadUrl(){
$fileModel = new File();
$info = $fileModel->read(['hash' => $this->param['hash']]);
$info = $fileModel->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$data = ['file_download'=>url('a/downLoad/files?hash='.$this->param['hash'])];
$data = ['file_download'=>url('a/downLoad/files?path='.$this->param['path'])];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -16,7 +16,7 @@ use Intervention\Image\Facades\Image;
class ImageController extends Controller
{
public $path = '';//路径
public $path = '/upload';//路径
public $config = '';//存储默认配置
... ... @@ -291,7 +291,7 @@ class ImageController extends Controller
*/
public function download(){
$imageModel = new ImageModel();
$info = $imageModel->read(['hash' => $this->param['hash']]);
$info = $imageModel->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
... ... @@ -404,11 +404,11 @@ class ImageController extends Controller
*/
public function getDownloadUrl(){
$imageModel = new ImageModel();
$info = $imageModel->read(['hash' => $this->param['hash']]);
$info = $imageModel->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$data = ['image_download'=>url('a/downLoad/images?hash='.$this->param['hash'])];
$data = ['image_download'=>url('a/downLoad/images?path='.$this->param['path'])];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -182,17 +182,17 @@ class CountLogic extends BaseLogic
case 'images':
$arr = explode(',',$v['values']);
foreach ($arr as $k1 => $v1){
$v['images_link'][$k1] = url('a/image/'.$v1);
$v['images_link'][$k1] = getImageUrl($v1);
}
break;
case 'android':
$v['android_link'] = url('a/image/'.$v['values']);
$v['android_link'] = getImageUrl($v['values']);
break;
case 'official_account':
$v['official_account_link'] = url('a/image/'.$v['values']);
$v['official_account_link'] = getImageUrl($v['values']);
break;
case 'ios':
$v['ios_link'] = url('a/image/'.$v['values']);
$v['ios_link'] = getImageUrl($v['values']);
break;
}
$lists[$k] = $v;
... ...
... ... @@ -30,7 +30,7 @@ class CosService
'secretKey' => $cos['credentials']['secretKey'],
],
]);
$key = 'upload'.$path.'/'.$filename;
$key = $path.'/'.$filename;
$cosClient->putObject([
'Bucket' => $cos['bucket'],
'Key' => $key,
... ...
... ... @@ -19,15 +19,15 @@ return [
'size' => [
'max' => 1024*1024*2, // 2M
],
'path_b' => '/p',
'path_a' => '/m',
'path_b' => '/upload/p',
'path_a' => '/upload/m',
],
//默认视频
'default_file' =>[
'size' => [
'max' => 1024*1024*20, // 2M
],
'path_b' => '/p',
'path_a' => '/m',
'path_b' => '/upload/p',
'path_a' => '/upload/m',
],
];
... ...