Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into master-server
正在显示
8 个修改的文件
包含
17 行增加
和
13 行删除
| @@ -644,11 +644,11 @@ if (!function_exists('getFileUrl')) { | @@ -644,11 +644,11 @@ if (!function_exists('getFileUrl')) { | ||
| 644 | * @method :post | 644 | * @method :post |
| 645 | * @time :2023/7/20 16:46 | 645 | * @time :2023/7/20 16:46 |
| 646 | */ | 646 | */ |
| 647 | - function getFileUrl($path,$storage_type = 0,$location = 0){ | 647 | + function getFileUrl($path,$storage_type = 0,$location = 0,$file_cdn = 0){ |
| 648 | if(is_array($path)){ | 648 | if(is_array($path)){ |
| 649 | $url =[]; | 649 | $url =[]; |
| 650 | foreach ($path as $v){ | 650 | foreach ($path as $v){ |
| 651 | - $url[] = getFileUrl($v,$storage_type,$location); | 651 | + $url[] = getFileUrl($v,$storage_type,$location,$file_cdn); |
| 652 | } | 652 | } |
| 653 | }else{ | 653 | }else{ |
| 654 | if(empty($path)){ | 654 | if(empty($path)){ |
| @@ -662,7 +662,7 @@ if (!function_exists('getFileUrl')) { | @@ -662,7 +662,7 @@ if (!function_exists('getFileUrl')) { | ||
| 662 | } | 662 | } |
| 663 | $file_type = pathinfo($path, PATHINFO_EXTENSION); | 663 | $file_type = pathinfo($path, PATHINFO_EXTENSION); |
| 664 | $fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx']; | 664 | $fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx']; |
| 665 | - if(in_array(strtolower($file_type),$fileTypeArr)){ | 665 | + if(in_array(strtolower($file_type),$fileTypeArr) && ($file_cdn == 0)){ |
| 666 | $cdn2 = config('filesystems.disks.cos')['cdn2']; | 666 | $cdn2 = config('filesystems.disks.cos')['cdn2']; |
| 667 | return $cdn2.$path; | 667 | return $cdn2.$path; |
| 668 | } | 668 | } |
| @@ -85,7 +85,7 @@ class CustomModuleContentController extends BaseController | @@ -85,7 +85,7 @@ class CustomModuleContentController extends BaseController | ||
| 85 | $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 85 | $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); |
| 86 | } | 86 | } |
| 87 | if(!empty($v['video'])){ | 87 | if(!empty($v['video'])){ |
| 88 | - $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 88 | + $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn']); |
| 89 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 89 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); |
| 90 | } | 90 | } |
| 91 | return $this->success($v); | 91 | return $this->success($v); |
| @@ -133,11 +133,11 @@ class ProductController extends BaseController | @@ -133,11 +133,11 @@ class ProductController extends BaseController | ||
| 133 | } | 133 | } |
| 134 | } | 134 | } |
| 135 | if(!empty($v['video'])){ | 135 | if(!empty($v['video'])){ |
| 136 | - $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 136 | + $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn']); |
| 137 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'] ?? '',$this->user['storage_type'] ?? 0,$this->user['project_location']); | 137 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'] ?? '',$this->user['storage_type'] ?? 0,$this->user['project_location']); |
| 138 | } | 138 | } |
| 139 | if(!empty($v['files']) && !empty($v['files']['url'])){ | 139 | if(!empty($v['files']) && !empty($v['files']['url'])){ |
| 140 | - $v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 140 | + $v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn']); |
| 141 | } | 141 | } |
| 142 | return $this->success($v); | 142 | return $this->success($v); |
| 143 | } | 143 | } |
| @@ -379,9 +379,9 @@ class ProductController extends BaseController | @@ -379,9 +379,9 @@ class ProductController extends BaseController | ||
| 379 | foreach ($arr1 as $k1=>$v1){ | 379 | foreach ($arr1 as $k1=>$v1){ |
| 380 | $v1 = (array)$v1; | 380 | $v1 = (array)$v1; |
| 381 | if(isset($v1['url'])){ | 381 | if(isset($v1['url'])){ |
| 382 | - $v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location']); | 382 | + $v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn']); |
| 383 | }else{ | 383 | }else{ |
| 384 | - $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location']); | 384 | + $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn']); |
| 385 | } | 385 | } |
| 386 | $arr1[$k1] = $v1; | 386 | $arr1[$k1] = $v1; |
| 387 | } | 387 | } |
| @@ -342,7 +342,7 @@ class FileController | @@ -342,7 +342,7 @@ class FileController | ||
| 342 | if ($info === false) { | 342 | if ($info === false) { |
| 343 | $this->response('指定文件不存在!', Code::USER_ERROR); | 343 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 344 | } | 344 | } |
| 345 | - $fileUrl = getFileUrl($info['path'],$info['is_cos']); | 345 | + $fileUrl = getFileUrl($info['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0); |
| 346 | // 设置响应头 | 346 | // 设置响应头 |
| 347 | header('Content-Description: File Transfer'); | 347 | header('Content-Description: File Transfer'); |
| 348 | header('Content-Type: application/octet-stream'); | 348 | header('Content-Type: application/octet-stream'); |
| @@ -392,7 +392,7 @@ class FileController | @@ -392,7 +392,7 @@ class FileController | ||
| 392 | $fileModel = new File(); | 392 | $fileModel = new File(); |
| 393 | $lists = $fileModel->list($this->map,'id',['id','hash','type','path','created_at','name']); | 393 | $lists = $fileModel->list($this->map,'id',['id','hash','type','path','created_at','name']); |
| 394 | foreach ($lists as $k => $v){ | 394 | foreach ($lists as $k => $v){ |
| 395 | - $v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0); | 395 | + $v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0); |
| 396 | $lists[$k] = $v; | 396 | $lists[$k] = $v; |
| 397 | } | 397 | } |
| 398 | $this->response('success',Code::SUCCESS,$lists); | 398 | $this->response('success',Code::SUCCESS,$lists); |
| @@ -408,7 +408,7 @@ class FileController | @@ -408,7 +408,7 @@ class FileController | ||
| 408 | public function responseData($path, $name){ | 408 | public function responseData($path, $name){ |
| 409 | $data = [ | 409 | $data = [ |
| 410 | 'file'=>$path, | 410 | 'file'=>$path, |
| 411 | - 'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0), | 411 | + 'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0), |
| 412 | 'name'=>$name, | 412 | 'name'=>$name, |
| 413 | 'file_download'=>url('a/download_files?path='.$path) | 413 | 'file_download'=>url('a/download_files?path='.$path) |
| 414 | ]; | 414 | ]; |
| @@ -66,7 +66,7 @@ class AyrReleaseLogic extends BaseLogic | @@ -66,7 +66,7 @@ class AyrReleaseLogic extends BaseLogic | ||
| 66 | $arr[] = getImageUrl($v1); | 66 | $arr[] = getImageUrl($v1); |
| 67 | } | 67 | } |
| 68 | }else{ | 68 | }else{ |
| 69 | - $arr[] = getFileUrl($v); | 69 | + $arr[] = getFileUrl($v,$this->user['storage_type'] ?? 0,$this->user['project_location'] ?? 0,$this->user['file_cdn'] ?? 0); |
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| @@ -94,7 +94,7 @@ class CustomModuleContentLogic extends BaseLogic | @@ -94,7 +94,7 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 94 | }elseif($v['type'] == 4){ | 94 | }elseif($v['type'] == 4){ |
| 95 | $arr1 = json_decode($info['values']); | 95 | $arr1 = json_decode($info['values']); |
| 96 | foreach ($arr1 as $k1=>$v1){ | 96 | foreach ($arr1 as $k1=>$v1){ |
| 97 | - $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location']); | 97 | + $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn']); |
| 98 | $arr1[$k1] = $v1; | 98 | $arr1[$k1] = $v1; |
| 99 | } | 99 | } |
| 100 | $v['values'] = $arr1; | 100 | $v['values'] = $arr1; |
| @@ -80,6 +80,9 @@ class TranslateLogic extends BaseLogic | @@ -80,6 +80,9 @@ class TranslateLogic extends BaseLogic | ||
| 80 | if(!empty($arr2)){ | 80 | if(!empty($arr2)){ |
| 81 | $i = 0; | 81 | $i = 0; |
| 82 | TranslateText: | 82 | TranslateText: |
| 83 | + if($languageInfo['short'] == 'zh-ct'){ | ||
| 84 | + $languageInfo['short'] = 'zh-TW'; | ||
| 85 | + } | ||
| 83 | $translate_list = Translate::tran($arr2, $languageInfo['short']); | 86 | $translate_list = Translate::tran($arr2, $languageInfo['short']); |
| 84 | if(empty($translate_list)){ | 87 | if(empty($translate_list)){ |
| 85 | if ($i < 3) { | 88 | if ($i < 3) { |
| @@ -279,6 +279,7 @@ class UserLoginLogic | @@ -279,6 +279,7 @@ class UserLoginLogic | ||
| 279 | $info['project_type'] = $project['type']; | 279 | $info['project_type'] = $project['type']; |
| 280 | $info['storage_type'] = $project['storage_type']; | 280 | $info['storage_type'] = $project['storage_type']; |
| 281 | $info['project_location'] = $project['project_location']; | 281 | $info['project_location'] = $project['project_location']; |
| 282 | + $info['file_cnd'] = $project['deploy_build']['file_cnd']; | ||
| 282 | $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0; | 283 | $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0; |
| 283 | $info['remain_day'] = $project['remain_day'] ?? 0; | 284 | $info['remain_day'] = $project['remain_day'] ?? 0; |
| 284 | if($info['is_customized'] == 1){ | 285 | if($info['is_customized'] == 1){ |
-
请 注册 或 登录 后发表评论