|
...
|
...
|
@@ -127,34 +127,34 @@ class LoginController extends BaseController |
|
|
|
preg_match_all('/<img src="([^"]+)"/', $v['html'], $matches);
|
|
|
|
if (!empty($matches[1])) {
|
|
|
|
$srcValues = $matches[1];
|
|
|
|
$imageModel = new Image();
|
|
|
|
foreach ($srcValues as $srcValue) {
|
|
|
|
$hash = basename($srcValue);
|
|
|
|
var_dump($hash);
|
|
|
|
die();
|
|
|
|
$image_info = $imageModel->read(['hash'=>$hash]);
|
|
|
|
if($image_info !== false){
|
|
|
|
$data['html'] = str_replace(
|
|
|
|
$hash,
|
|
|
|
basename($image_info['path']),
|
|
|
|
$v['html']
|
|
|
|
);
|
|
|
|
$data['head_html'] = str_replace(
|
|
|
|
$hash,
|
|
|
|
basename($image_info['path']),
|
|
|
|
$v['head_html']
|
|
|
|
);
|
|
|
|
$data['main_html'] = str_replace(
|
|
|
|
$hash,
|
|
|
|
basename($image_info['path']),
|
|
|
|
$v['main_html']
|
|
|
|
);
|
|
|
|
$data['footer_html'] = str_replace(
|
|
|
|
$hash,
|
|
|
|
basename($image_info['path']),
|
|
|
|
$v['footer_html']
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
echo "未找到 img 标签的 src 值";
|
|
|
|
}
|
|
|
|
$data['html'] = str_replace(
|
|
|
|
'https://develop.globalso.com/a/image/',
|
|
|
|
'https://ecdn6.globalso.com/public/template/',
|
|
|
|
$v['html']
|
|
|
|
);
|
|
|
|
$data['head_html'] = str_replace(
|
|
|
|
'https://develop.globalso.com/a/image/',
|
|
|
|
'https://ecdn6.globalso.com/public/template/',
|
|
|
|
$v['head_html']
|
|
|
|
);
|
|
|
|
$data['main_html'] = str_replace(
|
|
|
|
'https://develop.globalso.com/a/image/',
|
|
|
|
'https://ecdn6.globalso.com/public/template/',
|
|
|
|
$v['main_html']
|
|
|
|
);
|
|
|
|
$data['footer_html'] = str_replace(
|
|
|
|
'https://develop.globalso.com/a/image/',
|
|
|
|
'https://ecdn6.globalso.com/public/template/',
|
|
|
|
$v['footer_html']
|
|
|
|
);
|
|
|
|
$templateModel->edit($data,['id'=>$v['id']]);
|
|
|
|
}
|
|
|
|
return 1;
|
...
|
...
|
|