|
@@ -18,9 +18,12 @@ use App\Helper\Socket; |
|
@@ -18,9 +18,12 @@ use App\Helper\Socket; |
|
18
|
use App\Helper\Translate;
|
18
|
use App\Helper\Translate;
|
|
19
|
use App\Helper\Wechat;
|
19
|
use App\Helper\Wechat;
|
|
20
|
use App\Http\Logic\Bside\User\UserLoginLogic;
|
20
|
use App\Http\Logic\Bside\User\UserLoginLogic;
|
|
|
|
21
|
+use App\Models\File\Image;
|
|
21
|
use App\Models\Project\Project;
|
22
|
use App\Models\Project\Project;
|
|
22
|
use App\Models\Service\Service;
|
23
|
use App\Models\Service\Service;
|
|
23
|
use App\Models\Sms\SmsLog;
|
24
|
use App\Models\Sms\SmsLog;
|
|
|
|
25
|
+use App\Models\Template\Template;
|
|
|
|
26
|
+use App\Models\Template\TemplateModule;
|
|
24
|
use App\Models\User\User as UserModel;
|
27
|
use App\Models\User\User as UserModel;
|
|
25
|
use App\Utils\EncryptUtils;
|
28
|
use App\Utils\EncryptUtils;
|
|
26
|
use \Illuminate\Support\Facades\Cache;
|
29
|
use \Illuminate\Support\Facades\Cache;
|
|
@@ -257,8 +260,34 @@ class LoginController extends BaseController |
|
@@ -257,8 +260,34 @@ class LoginController extends BaseController |
|
257
|
|
260
|
|
|
258
|
|
261
|
|
|
259
|
public function ceshi(){
|
262
|
public function ceshi(){
|
|
260
|
- $url = "https://develop.globalso.com/upload/m/file/2023-08/64e86d1942c4c67754.psd";
|
|
|
|
261
|
- $urlParts = parse_url($url);
|
|
|
|
262
|
- str_replace('/upload', '', $urlParts['path']);
|
263
|
+ $templateModel = new TemplateModule();
|
|
|
|
264
|
+ $list = $templateModel->list();
|
|
|
|
265
|
+ foreach ($list as $k => $v){
|
|
|
|
266
|
+ // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值
|
|
|
|
267
|
+ preg_match_all('/\"https:\/\/admin.item.globalso.site\/a\/image\/(.*?)\"/', $v['html'], $matches);
|
|
|
|
268
|
+ if (!empty($matches[1])) {
|
|
|
|
269
|
+ $srcValues = $matches[1];
|
|
|
|
270
|
+ $imageModel = new Image();
|
|
|
|
271
|
+ $html = $v['html'];
|
|
|
|
272
|
+ foreach ($srcValues as $srcValue) {
|
|
|
|
273
|
+ $image_info = $imageModel->read(['hash'=>$srcValue]);
|
|
|
|
274
|
+ if($image_info !== false){
|
|
|
|
275
|
+ $path = basename($image_info['path']);
|
|
|
|
276
|
+ $html = $this->re($html,'/a/image/'.$srcValue,$path);
|
|
|
|
277
|
+ }
|
|
|
|
278
|
+ }
|
|
|
|
279
|
+ $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
|
|
|
|
280
|
+ }
|
|
|
|
281
|
+ }
|
|
|
|
282
|
+ return 1;
|
|
|
|
283
|
+ }
|
|
|
|
284
|
+
|
|
|
|
285
|
+ public function re(&$html,$srcValue,$path){
|
|
|
|
286
|
+ $html = str_replace(
|
|
|
|
287
|
+ $srcValue,
|
|
|
|
288
|
+ $path,
|
|
|
|
289
|
+ $html
|
|
|
|
290
|
+ );
|
|
|
|
291
|
+ return $html;
|
|
263
|
}
|
292
|
}
|
|
264
|
} |
293
|
} |