Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
7 个修改的文件
包含
38 行增加
和
25 行删除
| @@ -435,9 +435,9 @@ if (!function_exists('getImageUrl')) { | @@ -435,9 +435,9 @@ if (!function_exists('getImageUrl')) { | ||
| 435 | if($info['is_cos'] == 1){ | 435 | if($info['is_cos'] == 1){ |
| 436 | $cos = config('filesystems.disks.cos'); | 436 | $cos = config('filesystems.disks.cos'); |
| 437 | $cosCdn = $cos['cdn']; | 437 | $cosCdn = $cos['cdn']; |
| 438 | - $url = $cosCdn.'/upload'.$info['path']; | 438 | + $url = $cosCdn.$info['path']; |
| 439 | }else{ | 439 | }else{ |
| 440 | - $url = url('upload'.$info['path']); | 440 | + $url = url($info['path']); |
| 441 | } | 441 | } |
| 442 | }else{ | 442 | }else{ |
| 443 | $url = $hash; | 443 | $url = $hash; |
| @@ -526,7 +526,7 @@ if (!function_exists('str_replace_url')) { | @@ -526,7 +526,7 @@ if (!function_exists('str_replace_url')) { | ||
| 526 | $urlParts = parse_url($url); | 526 | $urlParts = parse_url($url); |
| 527 | // 检查是否存在 host(域名)部分 | 527 | // 检查是否存在 host(域名)部分 |
| 528 | if (isset($urlParts['path'])) { | 528 | if (isset($urlParts['path'])) { |
| 529 | - $urlWithoutDomain = str_replace('/upload', '', $urlParts['path']); | 529 | + $urlWithoutDomain = $urlParts['path']; |
| 530 | return $urlWithoutDomain; | 530 | return $urlWithoutDomain; |
| 531 | } else { | 531 | } else { |
| 532 | return $url; | 532 | return $url; |
| @@ -12,15 +12,12 @@ namespace App\Http\Controllers\Bside; | @@ -12,15 +12,12 @@ namespace App\Http\Controllers\Bside; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Events\WebSocketMessage; | 13 | use App\Events\WebSocketMessage; |
| 14 | use App\Events\WebSocketMessageSent; | 14 | use App\Events\WebSocketMessageSent; |
| 15 | -use App\Helper\Arr; | ||
| 16 | use App\Helper\Common; | 15 | use App\Helper\Common; |
| 17 | -use App\Helper\Socket; | ||
| 18 | use App\Helper\Translate; | 16 | use App\Helper\Translate; |
| 19 | use App\Helper\Wechat; | 17 | use App\Helper\Wechat; |
| 20 | use App\Http\Logic\Bside\User\UserLogic; | 18 | use App\Http\Logic\Bside\User\UserLogic; |
| 21 | use App\Http\Logic\Bside\User\UserLoginLogic; | 19 | use App\Http\Logic\Bside\User\UserLoginLogic; |
| 22 | -use App\Models\File\Image; | ||
| 23 | -use App\Models\Project\Project; | 20 | +use App\Models\File\Image as ImageModel; |
| 24 | use App\Models\Service\Service; | 21 | use App\Models\Service\Service; |
| 25 | use App\Models\Sms\SmsLog; | 22 | use App\Models\Sms\SmsLog; |
| 26 | use App\Models\Template\Template; | 23 | use App\Models\Template\Template; |
| @@ -283,11 +280,27 @@ class LoginController extends BaseController | @@ -283,11 +280,27 @@ class LoginController extends BaseController | ||
| 283 | }else{ | 280 | }else{ |
| 284 | $data = [ | 281 | $data = [ |
| 285 | 'code'=>0, | 282 | 'code'=>0, |
| 286 | - 'message'=>'关注成功,请登录后绑定账号后扫码', | 283 | + 'message'=>'关注成功,请登录后绑定账号后扫码,如已绑定,请再次扫码', |
| 287 | ]; | 284 | ]; |
| 288 | } | 285 | } |
| 289 | return $data; | 286 | return $data; |
| 290 | } | 287 | } |
| 291 | 288 | ||
| 292 | - | 289 | + public function ceshi(){ |
| 290 | + $templateModel = new TemplateModule(); | ||
| 291 | + $list = $templateModel->list(); | ||
| 292 | + $imageModel = new ImageModel(); | ||
| 293 | + foreach ($list as $k=>$v){ | ||
| 294 | + if (strpos($v['image'], '.') !== false) { | ||
| 295 | + $v['image'] = '/upload'.$v['image']; | ||
| 296 | + }else{ | ||
| 297 | + $info = $imageModel->read(['hash'=>$v['image']]); | ||
| 298 | + if($info !== false){ | ||
| 299 | + $v['image'] = $info['path']; | ||
| 300 | + } | ||
| 301 | + } | ||
| 302 | + $templateModel->edit(['image'=>$v['image']],['id'=>$v['id']]); | ||
| 303 | + } | ||
| 304 | + $this->response('success'); | ||
| 305 | + } | ||
| 293 | } | 306 | } |
| @@ -222,7 +222,7 @@ class FileController | @@ -222,7 +222,7 @@ class FileController | ||
| 222 | */ | 222 | */ |
| 223 | public function downLoad(){ | 223 | public function downLoad(){ |
| 224 | $file_model = new File(); | 224 | $file_model = new File(); |
| 225 | - $info = $file_model->read(['hash' => $this->param['hash']]); | 225 | + $info = $file_model->read(['path' => $this->param['path']]); |
| 226 | if ($info === false) { | 226 | if ($info === false) { |
| 227 | $this->response('指定文件不存在!', Code::USER_ERROR); | 227 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 228 | } | 228 | } |
| @@ -314,11 +314,11 @@ class FileController | @@ -314,11 +314,11 @@ class FileController | ||
| 314 | */ | 314 | */ |
| 315 | public function getDownloadUrl(){ | 315 | public function getDownloadUrl(){ |
| 316 | $fileModel = new File(); | 316 | $fileModel = new File(); |
| 317 | - $info = $fileModel->read(['hash' => $this->param['hash']]); | 317 | + $info = $fileModel->read(['path' => $this->param['path']]); |
| 318 | if ($info === false) { | 318 | if ($info === false) { |
| 319 | $this->response('指定文件不存在!', Code::USER_ERROR); | 319 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 320 | } | 320 | } |
| 321 | - $data = ['file_download'=>url('a/downLoad/files?hash='.$this->param['hash'])]; | 321 | + $data = ['file_download'=>url('a/downLoad/files?path='.$this->param['path'])]; |
| 322 | $this->response('success',Code::SUCCESS,$data); | 322 | $this->response('success',Code::SUCCESS,$data); |
| 323 | } | 323 | } |
| 324 | } | 324 | } |
| @@ -16,7 +16,7 @@ use Intervention\Image\Facades\Image; | @@ -16,7 +16,7 @@ use Intervention\Image\Facades\Image; | ||
| 16 | 16 | ||
| 17 | class ImageController extends Controller | 17 | class ImageController extends Controller |
| 18 | { | 18 | { |
| 19 | - public $path = '';//路径 | 19 | + public $path = '/upload';//路径 |
| 20 | 20 | ||
| 21 | public $config = '';//存储默认配置 | 21 | public $config = '';//存储默认配置 |
| 22 | 22 | ||
| @@ -291,7 +291,7 @@ class ImageController extends Controller | @@ -291,7 +291,7 @@ class ImageController extends Controller | ||
| 291 | */ | 291 | */ |
| 292 | public function download(){ | 292 | public function download(){ |
| 293 | $imageModel = new ImageModel(); | 293 | $imageModel = new ImageModel(); |
| 294 | - $info = $imageModel->read(['hash' => $this->param['hash']]); | 294 | + $info = $imageModel->read(['path' => $this->param['path']]); |
| 295 | if ($info === false) { | 295 | if ($info === false) { |
| 296 | $this->response('指定文件不存在!', Code::USER_ERROR); | 296 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 297 | } | 297 | } |
| @@ -404,11 +404,11 @@ class ImageController extends Controller | @@ -404,11 +404,11 @@ class ImageController extends Controller | ||
| 404 | */ | 404 | */ |
| 405 | public function getDownloadUrl(){ | 405 | public function getDownloadUrl(){ |
| 406 | $imageModel = new ImageModel(); | 406 | $imageModel = new ImageModel(); |
| 407 | - $info = $imageModel->read(['hash' => $this->param['hash']]); | 407 | + $info = $imageModel->read(['path' => $this->param['path']]); |
| 408 | if ($info === false) { | 408 | if ($info === false) { |
| 409 | $this->response('指定文件不存在!', Code::USER_ERROR); | 409 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 410 | } | 410 | } |
| 411 | - $data = ['image_download'=>url('a/downLoad/images?hash='.$this->param['hash'])]; | 411 | + $data = ['image_download'=>url('a/downLoad/images?path='.$this->param['path'])]; |
| 412 | $this->response('success',Code::SUCCESS,$data); | 412 | $this->response('success',Code::SUCCESS,$data); |
| 413 | } | 413 | } |
| 414 | } | 414 | } |
| @@ -182,17 +182,17 @@ class CountLogic extends BaseLogic | @@ -182,17 +182,17 @@ class CountLogic extends BaseLogic | ||
| 182 | case 'images': | 182 | case 'images': |
| 183 | $arr = explode(',',$v['values']); | 183 | $arr = explode(',',$v['values']); |
| 184 | foreach ($arr as $k1 => $v1){ | 184 | foreach ($arr as $k1 => $v1){ |
| 185 | - $v['images_link'][$k1] = url('a/image/'.$v1); | 185 | + $v['images_link'][$k1] = getImageUrl($v1); |
| 186 | } | 186 | } |
| 187 | break; | 187 | break; |
| 188 | case 'android': | 188 | case 'android': |
| 189 | - $v['android_link'] = url('a/image/'.$v['values']); | 189 | + $v['android_link'] = getImageUrl($v['values']); |
| 190 | break; | 190 | break; |
| 191 | case 'official_account': | 191 | case 'official_account': |
| 192 | - $v['official_account_link'] = url('a/image/'.$v['values']); | 192 | + $v['official_account_link'] = getImageUrl($v['values']); |
| 193 | break; | 193 | break; |
| 194 | case 'ios': | 194 | case 'ios': |
| 195 | - $v['ios_link'] = url('a/image/'.$v['values']); | 195 | + $v['ios_link'] = getImageUrl($v['values']); |
| 196 | break; | 196 | break; |
| 197 | } | 197 | } |
| 198 | $lists[$k] = $v; | 198 | $lists[$k] = $v; |
| @@ -30,7 +30,7 @@ class CosService | @@ -30,7 +30,7 @@ class CosService | ||
| 30 | 'secretKey' => $cos['credentials']['secretKey'], | 30 | 'secretKey' => $cos['credentials']['secretKey'], |
| 31 | ], | 31 | ], |
| 32 | ]); | 32 | ]); |
| 33 | - $key = 'upload'.$path.'/'.$filename; | 33 | + $key = $path.'/'.$filename; |
| 34 | $cosClient->putObject([ | 34 | $cosClient->putObject([ |
| 35 | 'Bucket' => $cos['bucket'], | 35 | 'Bucket' => $cos['bucket'], |
| 36 | 'Key' => $key, | 36 | 'Key' => $key, |
| @@ -19,15 +19,15 @@ return [ | @@ -19,15 +19,15 @@ return [ | ||
| 19 | 'size' => [ | 19 | 'size' => [ |
| 20 | 'max' => 1024*1024*2, // 2M | 20 | 'max' => 1024*1024*2, // 2M |
| 21 | ], | 21 | ], |
| 22 | - 'path_b' => '/p', | ||
| 23 | - 'path_a' => '/m', | 22 | + 'path_b' => '/upload/p', |
| 23 | + 'path_a' => '/upload/m', | ||
| 24 | ], | 24 | ], |
| 25 | //默认视频 | 25 | //默认视频 |
| 26 | 'default_file' =>[ | 26 | 'default_file' =>[ |
| 27 | 'size' => [ | 27 | 'size' => [ |
| 28 | 'max' => 1024*1024*20, // 2M | 28 | 'max' => 1024*1024*20, // 2M |
| 29 | ], | 29 | ], |
| 30 | - 'path_b' => '/p', | ||
| 31 | - 'path_a' => '/m', | 30 | + 'path_b' => '/upload/p', |
| 31 | + 'path_a' => '/upload/m', | ||
| 32 | ], | 32 | ], |
| 33 | ]; | 33 | ]; |
-
请 注册 或 登录 后发表评论