|
...
|
...
|
@@ -123,21 +123,9 @@ class LoginController extends BaseController |
|
|
|
$templateModel = new TemplateModule();
|
|
|
|
$list = $templateModel->list();
|
|
|
|
foreach ($list as $k => $v){
|
|
|
|
// 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值
|
|
|
|
preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
|
|
|
|
if (!empty($matches[1])) {
|
|
|
|
$srcValues = $matches[1];
|
|
|
|
$imageModel = new Image();
|
|
|
|
$html = $v['html'];
|
|
|
|
foreach ($srcValues as $srcValue) {
|
|
|
|
$image_info = $imageModel->read(['hash'=>$srcValue]);
|
|
|
|
if($image_info !== false){
|
|
|
|
$path = basename($image_info['path']);
|
|
|
|
$html = $this->re($html,$srcValue,$path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$templateModel->edit(['html'=>$html],['id'=>$v['id']]);
|
|
|
|
}
|
|
|
|
$html = $this->re($v['html'],'https://develop.globalso.com/a/image/','https://ecdn6.globalso.com/public/template/');
|
|
|
|
$html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/');
|
|
|
|
$templateModel->edit(['html'=>$html],['id'=>$v['id']]);
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
...
|
...
|
@@ -150,4 +138,18 @@ class LoginController extends BaseController |
|
|
|
);
|
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值
|
|
|
|
preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
|
|
|
|
if (!empty($matches[1])) {
|
|
|
|
$srcValues = $matches[1];
|
|
|
|
$imageModel = new Image();
|
|
|
|
$html = $v['html'];
|
|
|
|
foreach ($srcValues as $srcValue) {
|
|
|
|
$image_info = $imageModel->read(['hash'=>$srcValue]);
|
|
|
|
if($image_info !== false){
|
|
|
|
$path = basename($image_info['path']);
|
|
|
|
$html = $this->re($html,$srcValue,$path);
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
} |
...
|
...
|
|