chore: 添加静态资源文件和版本配置文件
添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材 添加系统版本配置文件(.version)和常量定义文件(.constant) 更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件 添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
39
crmeb/services/ai/Ai.php
Normal file
39
crmeb/services/ai/Ai.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace crmeb\services\ai;
|
||||
|
||||
use crmeb\basic\BaseManager;
|
||||
use crmeb\services\AccessTokenServeService;
|
||||
use think\Container;
|
||||
use think\facade\Config;
|
||||
|
||||
class Ai extends BaseManager
|
||||
{
|
||||
/**
|
||||
* 空间名
|
||||
* @var string
|
||||
*/
|
||||
protected string $namespace = '\\crmeb\\services\\ai\\storage\\';
|
||||
|
||||
protected function getDefaultDriver()
|
||||
{
|
||||
return Config::get('ai.default', 'ai');
|
||||
}
|
||||
|
||||
protected function invokeClass($class)
|
||||
{
|
||||
if (!class_exists($class)) {
|
||||
throw new \RuntimeException('class not exists: ' . $class);
|
||||
}
|
||||
|
||||
$this->getConfigFile();
|
||||
|
||||
if (!$this->config) {
|
||||
$this->config = Config::get($this->configFile . '.stores.' . $this->name, []);
|
||||
}
|
||||
$handleAccessToken = new AccessTokenServeService($this->config['access_key'] ?? '', $this->config['secret_key'] ?? '');
|
||||
$handle = Container::getInstance()->invokeClass($class, [$this->name, $handleAccessToken, $this->configFile]);
|
||||
$this->config = [];
|
||||
return $handle;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user