作者 刘锟

Merge remote-tracking branch 'origin/develop' into akun

@@ -509,16 +509,17 @@ if (!function_exists('str_replace_url')) { @@ -509,16 +509,17 @@ if (!function_exists('str_replace_url')) {
509 */ 509 */
510 function str_replace_url($url) 510 function str_replace_url($url)
511 { 511 {
  512 + if(!empty($url)){
512 // 使用 parse_url 函数来解析 URL 513 // 使用 parse_url 函数来解析 URL
513 $urlParts = parse_url($url); 514 $urlParts = parse_url($url);
514 // 检查是否存在 host(域名)部分 515 // 检查是否存在 host(域名)部分
515 if (isset($urlParts['path'])) { 516 if (isset($urlParts['path'])) {
516 $urlWithoutDomain = $urlParts['path']; 517 $urlWithoutDomain = $urlParts['path'];
517 return $urlWithoutDomain; 518 return $urlWithoutDomain;
518 - } else {  
519 - return $url;  
520 } 519 }
521 } 520 }
  521 + return $url;
  522 + }
522 } 523 }
523 524
524 if(!function_exists('curlGet')){ 525 if(!function_exists('curlGet')){
@@ -36,9 +36,8 @@ class NavLogic extends BaseLogic @@ -36,9 +36,8 @@ class NavLogic extends BaseLogic
36 { 36 {
37 DB::beginTransaction(); 37 DB::beginTransaction();
38 try { 38 try {
39 - if(isset($this->param['image']) && !empty($this->param['image'])){  
40 - $this->param['image'] = str_replace_url($this->param['image']);  
41 - } 39 + $this->param['image'] = str_replace_url(isset($this->param['image']) ?? '');
  40 + $this->param['remark_image'] = str_replace_url(isset($this->param['remark_image']) ?? '');
42 if(isset($this->param['id']) && !empty($this->param['id'])){ 41 if(isset($this->param['id']) && !empty($this->param['id'])){
43 $this->handleEditParam();//验证是否可编辑分类 42 $this->handleEditParam();//验证是否可编辑分类
44 $this->model->edit($this->param,['id'=>$this->param['id']]); 43 $this->model->edit($this->param,['id'=>$this->param['id']]);