作者 zhl

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

... ... @@ -526,9 +526,9 @@ if (!function_exists('str_replace_url')) {
$urlParts = parse_url($url);
// 检查是否存在 host(域名)部分
if (isset($urlParts['host'])) {
$domain = $urlParts['host'];
$path = $urlParts['path'];
// 使用 str_replace 函数删除域名信息
$urlWithoutDomain = str_replace($domain, '', $url);
$urlWithoutDomain = str_replace('upload', '', $url);
return $urlWithoutDomain;
} else {
return $url;
... ...
... ... @@ -157,7 +157,7 @@ class TaskController extends BaseController
$cosCdn = $cos['cdn'];
$v['attachment'] = $cosCdn.$file_info['path'];
}else{
$v['attachment'] = url('upload'.$v['attachment']);
$v['attachment'] = url('upload'.$file_info['path']);
}
}
return $v;
... ...
... ... @@ -257,13 +257,8 @@ class LoginController extends BaseController
public function ceshi(){
$data = [
'code'=>Code::USER_LOGIN_ERROE,
'message'=>'当前用户未绑定账户,请绑定后',
];
$webSocket = new Socket();
$webSocket->send('hello');
$response = $webSocket->receive();
$webSocket->close();
$url = "https://develop.globalso.com/upload/m/file/2023-08/64e86d1942c4c67754.psd";
$urlParts = parse_url($url);
return str_replace('upload', '', $urlParts['path']);
}
}
... ...
... ... @@ -265,7 +265,7 @@ class FileController
//根据项目上传标识区分上传到cos/本地
$projectModel = new Project();
$project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']);
if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器
if ($project_info['project_location'] == 0) {//通项目时 上传到cos
$this->upload_location = 1;//1:上传到本地
}
}
... ...
... ... @@ -372,7 +372,7 @@ class ImageController extends Controller
//根据项目上传标识区分上传到cos/本地
$projectModel = new Project();
$project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']);
if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器
if ($project_info['project_location'] == 0) {//普通项目时 上传到cos
$this->upload_location = 1;//上传到cos
}
}
... ...
... ... @@ -76,8 +76,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 11:57
*/
public function projectSave(){
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
$this->createProjectData($this->param);
//保存项目信息
$this->saveProject($this->param);
... ... @@ -89,11 +89,11 @@ class ProjectLogic extends BaseLogic
$this->saveProjectDeployOptimize($this->param['deploy_optimize']);
//保存售后信息
$this->saveProjectAfter($this->param['project_after']);
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('error');
// }
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('error');
}
return $this->success();
}
... ...
... ... @@ -45,9 +45,14 @@ class TaskLogic extends BaseLogic
$info['attachment'] = getFileUrl($info['attachment']);
$info['attachment_name'] = basename($info['attachment']);
}
if(!empty($info['follow']['attachment'])){
$info['follow']['attachment'] = getFileUrl($info['follow']['attachment']);
$info['follow']['attachment_name'] = basename($info['follow']['attachment']);
if(!empty($info['follow'])){
foreach ($info['follow'] as $k => $v){
if(!empty($v['attachment'])){
$v['attachment'] = getFileUrl($v['attachment']);
$v['attachment_name'] = basename($v['attachment']);
}
$info['follow'][$k] = $v;
}
}
return $this->success($info);
}
... ...
... ... @@ -64,19 +64,19 @@ class ATemplateModuleLogic extends BaseLogic
*/
public function setAttribute($param){
if(isset($param['image']) && !empty($param['image'])){
$param['image'] = basename($param['image']);
$param['image'] = str_replace_url($param['image']);
}
if(isset($param['images']) && !empty($param['images'])){
$arr_images = [];
foreach ($param['images'] as $v){
$arr_images[] = basename($v);
$arr_images[] = str_replace_url($v);
}
$param['images'] = implode(',',$arr_images);
}
if(isset($param['video']) && !empty($param['video'])){
$arr_video = [];
foreach ($param['video'] as $v){
$arr_video[] = basename($v);
$arr_video[] = $v;
}
$param['video'] = implode(',',$arr_video);
}
... ...
... ... @@ -155,7 +155,7 @@ class UserLoginLogic
$info['domain'] = (!empty($project['deploy_optimize']['domain']) ?
$project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? ''));
//保存项目缓存
Cache::put('user-'.$info['project_id'],$project,now()->addMinutes(60));
Cache::put('user-'.$info['project_id'],$project,$minutes = null);
return $this->success($info);
}
... ...