Base64Service.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\service\api\upload;
  12. use app\service\core\upload\CoreBase64Service;
  13. use core\base\BaseApiService;
  14. use Exception;
  15. /**
  16. * 用户服务层
  17. * Class BaseService
  18. * @package app\service
  19. */
  20. class Base64Service extends BaseApiService
  21. {
  22. private $root_path = 'base';
  23. /**
  24. * 远程拉取图片
  25. * @param string $content
  26. * @return array
  27. * @throws Exception
  28. */
  29. public function image(string $content){
  30. $dir = $this->root_path.'/'.'image'.'/'.date('Ym').'/'.date('d');
  31. $core_base64_service = new CoreBase64Service();
  32. return $core_base64_service->image($content,0, $dir);
  33. }
  34. }