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.
42 lines
1.2 KiB
42 lines
1.2 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\service\api\upload;
|
|
|
|
use app\service\core\upload\CoreBase64Service;
|
|
use core\base\BaseApiService;
|
|
use Exception;
|
|
|
|
/**
|
|
* 用户服务层
|
|
* Class BaseService
|
|
* @package app\service
|
|
*/
|
|
class Base64Service extends BaseApiService
|
|
{
|
|
private $root_path = 'base';
|
|
|
|
|
|
/**
|
|
* 远程拉取图片
|
|
* @param string $content
|
|
* @return array
|
|
* @throws Exception
|
|
*/
|
|
public function image(string $content){
|
|
|
|
$dir = $this->root_path.'/image/'.date('Ym').'/'.date('d');
|
|
$core_base64_service = new CoreBase64Service();
|
|
return $core_base64_service->image($content, $dir);
|
|
}
|
|
|
|
|
|
}
|
|
|