作者 lyh

gx

@@ -123,22 +123,10 @@ class LoginController extends BaseController @@ -123,22 +123,10 @@ class LoginController extends BaseController
123 $templateModel = new TemplateModule(); 123 $templateModel = new TemplateModule();
124 $list = $templateModel->list(); 124 $list = $templateModel->list();
125 foreach ($list as $k => $v){ 125 foreach ($list as $k => $v){
126 - // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值  
127 - preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);  
128 - if (!empty($matches[1])) {  
129 - $srcValues = $matches[1];  
130 - $imageModel = new Image();  
131 - $html = $v['html'];  
132 - foreach ($srcValues as $srcValue) {  
133 - $image_info = $imageModel->read(['hash'=>$srcValue]);  
134 - if($image_info !== false){  
135 - $path = basename($image_info['path']);  
136 - $html = $this->re($html,$srcValue,$path);  
137 - }  
138 - } 126 + $html = $this->re($v['html'],'https://develop.globalso.com/a/image/','https://ecdn6.globalso.com/public/template/');
  127 + $html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/');
139 $templateModel->edit(['html'=>$html],['id'=>$v['id']]); 128 $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
140 } 129 }
141 - }  
142 return 1; 130 return 1;
143 } 131 }
144 132
@@ -150,4 +138,18 @@ class LoginController extends BaseController @@ -150,4 +138,18 @@ class LoginController extends BaseController
150 ); 138 );
151 return $html; 139 return $html;
152 } 140 }
  141 +
  142 + /* // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值
  143 + preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
  144 + if (!empty($matches[1])) {
  145 + $srcValues = $matches[1];
  146 + $imageModel = new Image();
  147 + $html = $v['html'];
  148 + foreach ($srcValues as $srcValue) {
  149 + $image_info = $imageModel->read(['hash'=>$srcValue]);
  150 + if($image_info !== false){
  151 + $path = basename($image_info['path']);
  152 + $html = $this->re($html,$srcValue,$path);
  153 + }
  154 + }*/
153 } 155 }