截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PolicyLogic.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\api\logic;
  3. use app\common\basics\Logic;
  4. use app\common\server\ConfigServer;
  5. use app\common\server\UrlServer;
  6. class PolicyLogic extends Logic
  7. {
  8. public static function service()
  9. {
  10. $service = ConfigServer::get('policy', 'service', '');
  11. $preg = '/<img.*?src="((?!(https|http)).*?)".*?\/?>/i';
  12. $local_url = UrlServer::getFileUrl();
  13. $res = preg_replace($preg, '<img src="' . $local_url . '${1}" />', $service);
  14. return $res;
  15. }
  16. public static function privacy()
  17. {
  18. $privacy = ConfigServer::get('policy', 'privacy', '');
  19. $preg = '/<img.*?src="((?!(https|http)).*?)".*?\/?>/i';
  20. $local_url = UrlServer::getFileUrl();
  21. $res = preg_replace($preg, '<img src="' . $local_url . '${1}" />', $privacy);
  22. return $res;
  23. }
  24. public static function afterSale()
  25. {
  26. $after_sale = ConfigServer::get('policy', 'after_sale', '');
  27. $preg = '/<img.*?src="((?!(https|http)).*?)".*?\/?>/i';
  28. $local_url = UrlServer::getFileUrl();
  29. $res = preg_replace($preg, '<img src="' . $local_url . '${1}" />', $after_sale);
  30. return $res;
  31. }
  32. public static function userDelete()
  33. {
  34. $user_delete = ConfigServer::get('policy', 'user_delete', '');
  35. $preg = '/<img.*?src="((?!(https|http)).*?)".*?\/?>/i';
  36. $local_url = UrlServer::getFileUrl();
  37. $res = preg_replace($preg, '<img src="' . $local_url . '${1}" />', $user_delete);
  38. return $res;
  39. }
  40. }