作者 zhl

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

@@ -526,9 +526,9 @@ if (!function_exists('str_replace_url')) { @@ -526,9 +526,9 @@ if (!function_exists('str_replace_url')) {
526 $urlParts = parse_url($url); 526 $urlParts = parse_url($url);
527 // 检查是否存在 host(域名)部分 527 // 检查是否存在 host(域名)部分
528 if (isset($urlParts['host'])) { 528 if (isset($urlParts['host'])) {
529 - $domain = $urlParts['host']; 529 + $path = $urlParts['path'];
530 // 使用 str_replace 函数删除域名信息 530 // 使用 str_replace 函数删除域名信息
531 - $urlWithoutDomain = str_replace($domain, '', $url); 531 + $urlWithoutDomain = str_replace('upload', '', $url);
532 return $urlWithoutDomain; 532 return $urlWithoutDomain;
533 } else { 533 } else {
534 return $url; 534 return $url;
@@ -157,7 +157,7 @@ class TaskController extends BaseController @@ -157,7 +157,7 @@ class TaskController extends BaseController
157 $cosCdn = $cos['cdn']; 157 $cosCdn = $cos['cdn'];
158 $v['attachment'] = $cosCdn.$file_info['path']; 158 $v['attachment'] = $cosCdn.$file_info['path'];
159 }else{ 159 }else{
160 - $v['attachment'] = url('upload'.$v['attachment']); 160 + $v['attachment'] = url('upload'.$file_info['path']);
161 } 161 }
162 } 162 }
163 return $v; 163 return $v;
@@ -257,13 +257,8 @@ class LoginController extends BaseController @@ -257,13 +257,8 @@ class LoginController extends BaseController
257 257
258 258
259 public function ceshi(){ 259 public function ceshi(){
260 - $data = [  
261 - 'code'=>Code::USER_LOGIN_ERROE,  
262 - 'message'=>'当前用户未绑定账户,请绑定后',  
263 - ];  
264 - $webSocket = new Socket();  
265 - $webSocket->send('hello');  
266 - $response = $webSocket->receive();  
267 - $webSocket->close(); 260 + $url = "https://develop.globalso.com/upload/m/file/2023-08/64e86d1942c4c67754.psd";
  261 + $urlParts = parse_url($url);
  262 + return str_replace('upload', '', $urlParts['path']);
268 } 263 }
269 } 264 }
@@ -265,7 +265,7 @@ class FileController @@ -265,7 +265,7 @@ class FileController
265 //根据项目上传标识区分上传到cos/本地 265 //根据项目上传标识区分上传到cos/本地
266 $projectModel = new Project(); 266 $projectModel = new Project();
267 $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']); 267 $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']);
268 - if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器 268 + if ($project_info['project_location'] == 0) {//通项目时 上传到cos
269 $this->upload_location = 1;//1:上传到本地 269 $this->upload_location = 1;//1:上传到本地
270 } 270 }
271 } 271 }
@@ -372,7 +372,7 @@ class ImageController extends Controller @@ -372,7 +372,7 @@ class ImageController extends Controller
372 //根据项目上传标识区分上传到cos/本地 372 //根据项目上传标识区分上传到cos/本地
373 $projectModel = new Project(); 373 $projectModel = new Project();
374 $project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']); 374 $project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']);
375 - if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器 375 + if ($project_info['project_location'] == 0) {//普通项目时 上传到cos
376 $this->upload_location = 1;//上传到cos 376 $this->upload_location = 1;//上传到cos
377 } 377 }
378 } 378 }
@@ -76,8 +76,8 @@ class ProjectLogic extends BaseLogic @@ -76,8 +76,8 @@ class ProjectLogic extends BaseLogic
76 * @time :2023/8/30 11:57 76 * @time :2023/8/30 11:57
77 */ 77 */
78 public function projectSave(){ 78 public function projectSave(){
79 -// DB::beginTransaction();  
80 -// try { 79 + DB::beginTransaction();
  80 + try {
81 $this->createProjectData($this->param); 81 $this->createProjectData($this->param);
82 //保存项目信息 82 //保存项目信息
83 $this->saveProject($this->param); 83 $this->saveProject($this->param);
@@ -89,11 +89,11 @@ class ProjectLogic extends BaseLogic @@ -89,11 +89,11 @@ class ProjectLogic extends BaseLogic
89 $this->saveProjectDeployOptimize($this->param['deploy_optimize']); 89 $this->saveProjectDeployOptimize($this->param['deploy_optimize']);
90 //保存售后信息 90 //保存售后信息
91 $this->saveProjectAfter($this->param['project_after']); 91 $this->saveProjectAfter($this->param['project_after']);
92 -// DB::commit();  
93 -// }catch (\Exception $e){  
94 -// DB::rollBack();  
95 -// $this->fail('error');  
96 -// } 92 + DB::commit();
  93 + }catch (\Exception $e){
  94 + DB::rollBack();
  95 + $this->fail('error');
  96 + }
97 return $this->success(); 97 return $this->success();
98 } 98 }
99 99
@@ -45,9 +45,14 @@ class TaskLogic extends BaseLogic @@ -45,9 +45,14 @@ class TaskLogic extends BaseLogic
45 $info['attachment'] = getFileUrl($info['attachment']); 45 $info['attachment'] = getFileUrl($info['attachment']);
46 $info['attachment_name'] = basename($info['attachment']); 46 $info['attachment_name'] = basename($info['attachment']);
47 } 47 }
48 - if(!empty($info['follow']['attachment'])){  
49 - $info['follow']['attachment'] = getFileUrl($info['follow']['attachment']);  
50 - $info['follow']['attachment_name'] = basename($info['follow']['attachment']); 48 + if(!empty($info['follow'])){
  49 + foreach ($info['follow'] as $k => $v){
  50 + if(!empty($v['attachment'])){
  51 + $v['attachment'] = getFileUrl($v['attachment']);
  52 + $v['attachment_name'] = basename($v['attachment']);
  53 + }
  54 + $info['follow'][$k] = $v;
  55 + }
51 } 56 }
52 return $this->success($info); 57 return $this->success($info);
53 } 58 }
@@ -64,19 +64,19 @@ class ATemplateModuleLogic extends BaseLogic @@ -64,19 +64,19 @@ class ATemplateModuleLogic extends BaseLogic
64 */ 64 */
65 public function setAttribute($param){ 65 public function setAttribute($param){
66 if(isset($param['image']) && !empty($param['image'])){ 66 if(isset($param['image']) && !empty($param['image'])){
67 - $param['image'] = basename($param['image']); 67 + $param['image'] = str_replace_url($param['image']);
68 } 68 }
69 if(isset($param['images']) && !empty($param['images'])){ 69 if(isset($param['images']) && !empty($param['images'])){
70 $arr_images = []; 70 $arr_images = [];
71 foreach ($param['images'] as $v){ 71 foreach ($param['images'] as $v){
72 - $arr_images[] = basename($v); 72 + $arr_images[] = str_replace_url($v);
73 } 73 }
74 $param['images'] = implode(',',$arr_images); 74 $param['images'] = implode(',',$arr_images);
75 } 75 }
76 if(isset($param['video']) && !empty($param['video'])){ 76 if(isset($param['video']) && !empty($param['video'])){
77 $arr_video = []; 77 $arr_video = [];
78 foreach ($param['video'] as $v){ 78 foreach ($param['video'] as $v){
79 - $arr_video[] = basename($v); 79 + $arr_video[] = $v;
80 } 80 }
81 $param['video'] = implode(',',$arr_video); 81 $param['video'] = implode(',',$arr_video);
82 } 82 }
@@ -155,7 +155,7 @@ class UserLoginLogic @@ -155,7 +155,7 @@ class UserLoginLogic
155 $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? 155 $info['domain'] = (!empty($project['deploy_optimize']['domain']) ?
156 $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '')); 156 $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? ''));
157 //保存项目缓存 157 //保存项目缓存
158 - Cache::put('user-'.$info['project_id'],$project,now()->addMinutes(60)); 158 + Cache::put('user-'.$info['project_id'],$project,$minutes = null);
159 return $this->success($info); 159 return $this->success($info);
160 } 160 }
161 161