FastMovieAI 二开基线 v1.0 (完整源码)

This commit is contained in:
李建琦
2026-08-26 18:41:02 +08:00
parent fad7690c0c
commit d54584f70d
888 changed files with 105571 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use support\Request;
return [
'debug' => getenv('DEBUG') === 'true',
'error_reporting' => E_ALL,
'default_timezone' => 'Asia/Shanghai',
'request_class' => Request::class,
'public_path' => base_path() . DIRECTORY_SEPARATOR . 'public',
'runtime_path' => base_path(false) . DIRECTORY_SEPARATOR . 'runtime',
'controller_suffix' => 'Controller',
'controller_reuse' => false,
];
+21
View File
@@ -0,0 +1,21 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'files' => [
base_path() . '/app/functions.php',
base_path() . '/support/Request.php',
base_path() . '/support/Response.php',
]
];
+19
View File
@@ -0,0 +1,19 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
support\bootstrap\Session::class,
Webman\ThinkOrm\ThinkOrm::class,
support\Event::class,
];
+31
View File
@@ -0,0 +1,31 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => 'redis',
'stores' => [
'file' => [
'driver' => 'file',
'path' => runtime_path('cache')
],
'redis' => [
'driver' => 'redis',
'connection' => 'default'
],
'array' => [
'driver' => 'array'
]
]
];
+15
View File
@@ -0,0 +1,15 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return new Webman\Container;
+15
View File
@@ -0,0 +1,15 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [];
+15
View File
@@ -0,0 +1,15 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [];
+5
View File
@@ -0,0 +1,5 @@
<?php
return [
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
'admin' => app\exception\Handler::class,
'control' => app\exception\Handler::class,
];
+32
View File
@@ -0,0 +1,32 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => [
'handlers' => [
[
'class' => Monolog\Handler\RotatingFileHandler::class,
'constructor' => [
runtime_path() . '/logs/webman.log',
7, //$maxFiles
getenv('DEBUG') === 'true'?\Monolog\Level::Debug:\Monolog\Level::Warning,
],
'formatter' => [
'class' => Monolog\Formatter\LineFormatter::class,
'constructor' => [null, 'Y-m-d H:i:s', true],
],
]
],
],
];
+10
View File
@@ -0,0 +1,10 @@
<?php
return [
'' => [
app\middleware\Template::class,
app\middleware\Platform::class
],
'admin' => [
app\admin\middleware\Auth::class
]
];
+16
View File
@@ -0,0 +1,16 @@
<?php
return [
'certs' => config_path('certs'),
'rsa_privatekey' => config_path('certs') . '/rsa_private.pem',
'rsa_publickey' => config_path('certs') . '/rsa_public.pem',
'prefix' => 'oauth',
'expire' => 3600*24*30,
'single' => false,
'redis' => [
'host' => getenv('REDIS_HOST'),
'password' => getenv('REDIS_PASSWORD'),
'port' => getenv('REDIS_PORT'),
'select' => getenv('REDIS_DATABASE'),
],
];
@@ -0,0 +1,118 @@
<?php
$origin = [
'enable' => true,
'default' => 'local',
'max_size' => 1024 * 1024 * 10, //单个文件大小10M
'ext_yes' => [], //允许上传文件类型 为空则为允许所有
'ext_no' => [], // 不允许上传文件类型 为空则不限制
'storage' => [
'public' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\LocalAdapterFactory::class,
'root' => public_path(),
'url' => '//127.0.0.1:8787' // 静态文件访问域名
],
'local' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\LocalAdapterFactory::class,
'root' => base_path(),
'url' => '//127.0.0.1:8787' // 静态文件访问域名
],
'ftp' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\FtpAdapterFactory::class,
'host' => 'ftp.example.com',
'username' => 'username',
'password' => 'password',
'url' => '', // 静态文件访问域名
'port' => 21,
'root' => '/path/to/root',
'passive' => true,
'ssl' => true,
'timeout' => 30,
'ignorePassiveAddress' => false,
'timestampsOnUnixListingsEnabled' => true,
],
'memory' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\MemoryAdapterFactory::class,
],
's3' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\S3AdapterFactory::class,
'credentials' => [
'key' => 'S3_KEY',
'secret' => 'S3_SECRET',
],
'region' => 'S3_REGION',
'version' => 'latest',
'bucket_endpoint' => false,
'use_path_style_endpoint' => false,
'endpoint' => 'S3_ENDPOINT',
'bucket_name' => 'S3_BUCKET',
'url' => '' // 静态文件访问域名
],
'minio' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\S3AdapterFactory::class,
'credentials' => [
'key' => 'S3_KEY',
'secret' => 'S3_SECRET',
],
'region' => 'S3_REGION',
'version' => 'latest',
'bucket_endpoint' => false,
'use_path_style_endpoint' => true,
'endpoint' => 'S3_ENDPOINT',
'bucket_name' => 'S3_BUCKET',
'url' => '' // 静态文件访问域名
],
'oss' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\AliyunOssAdapterFactory::class,
'accessId' => 'OSS_ACCESS_ID',
'accessSecret' => 'OSS_ACCESS_SECRET',
'bucket' => 'OSS_BUCKET',
'endpoint' => 'OSS_ENDPOINT',
'url' => '', // 静态文件访问域名
'timeout' => 3600,
'connectTimeout' => 10,
'isCName' => false,
'token' => null,
'proxy' => null,
],
'qiniu' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\QiniuAdapterFactory::class,
'accessKey' => 'QINIU_ACCESS_KEY',
'secretKey' => 'QINIU_SECRET_KEY',
'bucket' => 'QINIU_BUCKET',
'domain' => 'QINBIU_DOMAIN',
'url' => '' // 静态文件访问域名
],
'cos' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\CosAdapterFactory::class,
'region' => 'COS_REGION',
'app_id' => 'COS_APPID',
'secret_id' => 'COS_SECRET_ID',
'secret_key' => 'COS_SECRET_KEY',
// 可选,如果 bucket 为私有访问请打开此项
'signed_url' => false,
'bucket' => 'COS_BUCKET',
'read_from_cdn' => false,
'url' => '' // 静态文件访问域名
// 'timeout' => 60,
// 'connect_timeout' => 60,
// 'cdn' => '',
// 'scheme' => 'https',
],
],
];
$filePath = config_path("plugin/shopwwi/filesystem/app.json");
if (file_exists($filePath)) {
$user = file_get_contents($filePath);
$user = json_decode($user, true);
foreach ($user as $key => $value) {
if ($key !== 'storage') {
$origin[$key] = $value;
}
}
foreach ($origin['storage'] as $key => $value) {
if (isset($user['storage'][$key])) {
$origin['storage'][$key] = array_merge($origin['storage'][$key], $user['storage'][$key]);
}
}
}
return $origin;
@@ -0,0 +1,22 @@
<?php
return [
'enable' => true,
'build_dir' => BASE_PATH . DIRECTORY_SEPARATOR . 'build',
'phar_filename' => 'webman.phar',
'bin_filename' => 'webman.bin',
'signature_algorithm' => Phar::SHA256, //set the signature algorithm for a phar and apply it. The signature algorithm must be one of Phar::MD5, Phar::SHA1, Phar::SHA256, Phar::SHA512, or Phar::OPENSSL.
'private_key_file' => '', // The file path for certificate or OpenSSL private key file.
'exclude_pattern' => '#^(?!.*(composer.json|/.github/|/.idea/|/.git/|/.setting/|/runtime/|/vendor-bin/|/build/|/vendor/webman/admin/))(.*)$#',
'exclude_files' => [
'.env', 'LICENSE', 'composer.json', 'composer.lock', 'start.php', 'webman.phar', 'webman.bin'
],
'custom_ini' => 'memory_limit = 256M',
];
@@ -0,0 +1,4 @@
<?php
return [
'enable' => true,
];
@@ -0,0 +1,17 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
Webman\Event\BootStrap::class,
];
@@ -0,0 +1,7 @@
<?php
use Webman\Event\EventListCommand;
return [
EventListCommand::class
];
@@ -0,0 +1,12 @@
<?php
$enable=file_exists(base_path('plugin/notification'));
$d=[
'enable' => $enable,
'websocket' => 'websocket://0.0.0.0:'.getenv('PUSH_WSS_PORT'),
'api' => 'http://0.0.0.0:'.getenv('PUSH_API_PORT'),
'app_key' => getenv('PUSH_KEY'),
'app_secret' => getenv('PUSH_SCERET'),
'channel_hook' => 'http://127.0.0.1:'.getenv('SERVER_PORT').'/app/notification/push/hook',
'auth' => '/app/notification/api/push/auth'
];
return $d;
@@ -0,0 +1,21 @@
<?php
use Webman\Push\Server;
$enable=file_exists(base_path('plugin/notification'));
return [
'server' => [
'enable' => $enable,
'handler' => Server::class,
'listen' => 'websocket://0.0.0.0:'.getenv('PUSH_WSS_PORT'),
'count' => 1,
'constructor' => [
'api_listen' => 'http://0.0.0.0:'.getenv('PUSH_API_PORT'),
'app_info' => [
getenv('PUSH_KEY') => [
'channel_hook' => 'http://127.0.0.1:'.getenv('SERVER_PORT').'/app/notification/push/hook',
'app_secret' => getenv('PUSH_SCERET'),
],
],
]
],
];
@@ -0,0 +1,26 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use support\Request;
use Webman\Route;
$enable=file_exists(base_path('plugin/notification'));
if($enable){
/**
* 推送js客户端文件
*/
Route::get('/plugin/webman/push/push.js', function (Request $request) {
return response()->file(base_path().'/vendor/webman/push/src/push.js');
});
}
+73
View File
@@ -0,0 +1,73 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use app\process\AutoDeleteUpload;
use support\Log;
use support\Request;
use app\process\Http;
use app\process\Monitor;
use Workerman\Events\Select;
global $argv;
return [
'webman' => [
'handler' => Http::class,
'listen' => 'http://0.0.0.0:' . getenv('SERVER_PORT'),
'count' => getenv('DEBUG') == 'true' ? 1 : cpu_count(),
'user' => '',
'group' => '',
'reusePort' => false,
'eventLoop' => Select::class,
'context' => [],
'constructor' => [
'requestClass' => Request::class,
'logger' => Log::channel('default'),
'appPath' => app_path(),
'publicPath' => public_path()
]
],
// File update detection and automatic reload
'monitor' => [
'handler' => Monitor::class,
'reloadable' => false,
'constructor' => [
// Monitor these directories
'monitorDir' => array_merge([
app_path(),
config_path(),
base_path() . '/process',
base_path() . '/support',
base_path() . '/resource',
base_path() . '/.env',
], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
// Files with these suffixes will be monitored
'monitorExtensions' => [
'php',
'html',
'htm',
'env'
],
'options' => [
'enable_file_monitor' => !in_array('-d', $argv) && getenv('DEBUG') === 'true' && DIRECTORY_SEPARATOR === '/',
'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
]
]
],
'AutoDeleteUpload' => [
'handler' => AutoDeleteUpload::class,
'eventLoop' => Select::class,
]
];
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => [
'host' => getenv('REDIS_HOST'),
'password' => getenv('REDIS_PASSWORD'),
'port' => getenv('REDIS_PORT'),
'database' => getenv('REDIS_DATABASE'),
'pool' => [ // 连接池配置,仅支持swoole/swow驱动
'max_connections' => (int)getenv('REDIS_MAX_CONNECTIONS'), // 最大连接数
'min_connections' => (int)getenv('REDIS_MIN_CONNECTIONS'), // 最小连接数
'wait_timeout' => (int)getenv('REDIS_WAIT_TIMEOUT'), // 从连接池获取连接等待的最大时间,超时后会抛出异常
'idle_timeout' => (int)getenv('REDIS_IDLE_TIMEOUT'), // 连接池中连接最大空闲时间,超时后会关闭回收,直到连接数为min_connections
'heartbeat_interval' => (int)getenv('REDIS_HEARTBEAT_INTERVAL'), // 连接池心跳检测时间,单位秒,建议小于60秒
],
],
];
+8
View File
@@ -0,0 +1,8 @@
<?php
use Webman\Route;
Route::get('/fastmovie', [app\controller\IndexController::class, 'fastmovie']);
Route::get('/fastmovie/', [app\controller\IndexController::class, 'fastmovie']);
Route::any('/notify/wechat/{plugin}/{template_id}', [app\controller\NotifyController::class, 'wechat']);
require_once app_path('admin/config/route.php');
+22
View File
@@ -0,0 +1,22 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'stop_timeout' => 2,
'pid_file' => runtime_path() . '/webman.pid',
'status_file' => runtime_path() . '/webman.status',
'stdout_file' => runtime_path() . '/logs/stdout.log',
'log_file' => runtime_path() . '/logs/workerman.log',
'max_package_size' => 100 * 1024 * 1024
];
+65
View File
@@ -0,0 +1,65 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Webman\Session\FileSessionHandler;
use Webman\Session\RedisSessionHandler;
use Webman\Session\RedisClusterSessionHandler;
return [
'type' => 'file', // or redis or redis_cluster
'handler' => FileSessionHandler::class,
'config' => [
'file' => [
'save_path' => runtime_path() . '/sessions',
],
'redis' => [
'host' => '127.0.0.1',
'port' => 6379,
'auth' => '',
'timeout' => 2,
'database' => '',
'prefix' => 'redis_session_',
],
'redis_cluster' => [
'host' => ['127.0.0.1:7000', '127.0.0.1:7001', '127.0.0.1:7001'],
'timeout' => 2,
'auth' => '',
'prefix' => 'redis_session_',
]
],
'session_name' => 'PHPSID',
'auto_update_timestamp' => false,
'lifetime' => 7*24*60*60,
'cookie_lifetime' => 365*24*60*60,
'cookie_path' => '/',
'domain' => '',
'http_only' => true,
'secure' => false,
'same_site' => '',
'gc_probability' => [1, 1000],
];
+15
View File
@@ -0,0 +1,15 @@
<?php
$THdgztKTYJsWLLXZcXQMGIuHfRryJoAqKEGVReirMgDnJIxhUwHDVjClOKKcXKSD = [];
$GhegubjlWqkgItXJzzWLDAzbHcpbVXshbBaQUQkOvJmzcCkvKXSmNcfITiRoNRrE = glob(config_path('settings-tabs') . '/*.php');
foreach ($GhegubjlWqkgItXJzzWLDAzbHcpbVXshbBaQUQkOvJmzcCkvKXSmNcfITiRoNRrE as $path) {
$group = basename($path, '.php');
$THdgztKTYJsWLLXZcXQMGIuHfRryJoAqKEGVReirMgDnJIxhUwHDVjClOKKcXKSD[$group] = require $path;
}
$GhegubjlWqkgItXJzzWLDAzbHcpbVXshbBaQUQkOvJmzcCkvKXSmNcfITiRoNRrE = glob(base_path('plugin/*/config/settings-tabs/*.php'));
foreach ($GhegubjlWqkgItXJzzWLDAzbHcpbVXshbBaQUQkOvJmzcCkvKXSmNcfITiRoNRrE as $path) {
$plugin_name = basename(dirname(dirname(dirname($path))));
$group = basename($path, '.php');
$THdgztKTYJsWLLXZcXQMGIuHfRryJoAqKEGVReirMgDnJIxhUwHDVjClOKKcXKSD[$plugin_name . '.' . $group] = require $path;
}
return $THdgztKTYJsWLLXZcXQMGIuHfRryJoAqKEGVReirMgDnJIxhUwHDVjClOKKcXKSD;
@@ -0,0 +1,272 @@
<?php
use app\expose\build\builder\ComponentBuilder;
use app\expose\enum\SmsChannels;
use plugin\user\utils\enum\VcodeScene;
$Component = new ComponentBuilder;
$vcode_templates=[];
$options=VcodeScene::getOptions();
foreach ($options as $key => $value) {
$prompt=$Component->add("text", ["default" => "短信模板ID,变量:"], ["type" => "info", "size" => "small"]);
foreach ($value['variable'] as $k => $v) {
$prompt->add("tag", ["default" => $v.''.$k], ["type" => "info", "size" => "small"]);
}
$vcode_templates[]=[
'title' => $value['label'].'短信模板ID',
'field' => 'vcode_template_'.$value['value'],
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['enable', '=', true]
],
"prompt" => [
$prompt->builder()
]
]
];
}
return [
[
'title' => '服务商',
'field' => 'channels',
'value' => [SmsChannels::ALIYUN['value'], SmsChannels::TENCENT['value'], SmsChannels::SMSBAO['value']],
'component' => 'drag-sort',
'extra' => [
'required' => true,
'prompt' => [
$Component->add('text', ['default' => '短信服务商优先级,当发送失败时,会自动切换到下一个服务商'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'options' => SmsChannels::getOptions(),
]
],
'group' => [
[
'title' => SmsChannels::ALIYUN['label'],
'name' => SmsChannels::ALIYUN['value'],
'children' => [
[
'title' => '开关',
'field' => 'enable',
'value' => false,
'component' => 'switch',
'extra' => [
'prompt' => [
$Component->add('text', ['default' => '是否启用阿里云短信服务'], ['type' => 'info', 'size' => 'small'])
->builder()
]
]
],
[
'title' => 'AccessKey ID',
'field' => 'access_key_id',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['enable', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '阿里云-AccessKey管理-AccessKey ID'], ['type' => 'info', 'size' => 'small'])
->add('link', ['default' => '阿里云AccessKey'], ['target' => '_blank', 'href' => 'https://ram.console.aliyun.com/manage/ak', 'type' => 'info', 'underline' => 'never', 'size' => 'small'])
->builder()
]
]
],
[
'title' => 'AccessKey Secret',
'field' => 'access_secret',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['enable', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '阿里云-AccessKey管理-AccessKey Secret'], ['type' => 'info', 'size' => 'small'])
->builder()
]
]
],
[
'title' => '短信签名',
'field' => 'sign_name',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['enable', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '阿里云-短信服务-国内消息-签名管理,'], ['type' => 'info', 'size' => 'small'])
->add('link', ['default' => '阿里云短信签名'], ['target' => '_blank', 'href' => 'https://dysms.console.aliyun.com/domestic/text', 'type' => 'info', 'underline' => 'never', 'size' => 'small'])
->builder()
]
]
],
...$vcode_templates
]
],
[
"title" => SmsChannels::TENCENT['label'],
"name" => SmsChannels::TENCENT['value'],
"children" => [
[
'title' => '开关',
'field' => 'enable',
'value' => false,
'component' => 'switch',
'extra' => [
'prompt' => [
$Component->add('text', ['default' => '是否启用腾讯云短信服务'], ['type' => 'info', 'size' => 'small'])
->builder()
]
]
],
[
"title" => "SecretId",
"field" => "secret_id",
"value" => "",
"component" => "input",
"extra" => [
"required" => true,
'where' => [
['enable', '=', true]
],
"prompt" => [
$Component->add("text", ["default" => "腾讯云-访问管理-访问密钥-AccessKey ID"], ["type" => "info", "size" => "small"])
->add("link", ["default" => "腾讯云SecretId"], ["target" => "_blank", "href" => "https://console.cloud.tencent.com/cam/capi", "type" => "info", 'underline' => 'never', "size" => "small"])
->builder()
]
]
],
[
"title" => "SecretKey",
"field" => "secret_key",
"value" => "",
"component" => "input",
"extra" => [
"required" => true,
'where' => [
['enable', '=', true]
],
"prompt" => [
$Component->add("text", ["default" => "腾讯云-访问管理-访问密钥-AccessKey Secret"], ["type" => "info", "size" => "small"])
->add("link", ["default" => "腾讯云SecretKey"], ["target" => "_blank", "href" => "https://console.cloud.tencent.com/cam/capi", "type" => "info", 'underline' => 'never', "size" => "small"])
->builder()
]
]
],
[
"title" => "应用 ID",
"field" => "appid",
"value" => "",
"component" => "input",
"extra" => [
"required" => true,
'where' => [
['enable', '=', true]
],
"prompt" => [
$Component->add("text", ["default" => "腾讯云-短信-应用管理-应用 ID"], ["type" => "info", "size" => "small"])
->add("link", ["default" => "腾讯云应用 ID"], ["target" => "_blank", "href" => "https://console.cloud.tencent.com/smsv2/app-manage", "type" => "info", 'underline' => 'never', "size" => "small"])
->builder()
]
]
],
[
"title" => "短信签名",
"field" => "sign_name",
"value" => "",
"component" => "input",
"extra" => [
"required" => true,
'where' => [
['enable', '=', true]
],
"prompt" => [
$Component->add("text", ["default" => "腾讯云-短信-国内短信-签名管理,"], ["type" => "info", "size" => "small"])
->add("link", ["default" => "腾讯云短信签名"], ["target" => "_blank", "href" => "https://console.cloud.tencent.com/smsv2/csms-sign", "type" => "info", 'underline' => 'never', "size" => "small"])
->builder()
]
]
],
...$vcode_templates
]
],
[
"title" => SmsChannels::SMSBAO['label'],
"name" => SmsChannels::SMSBAO['value'],
"children" => [
[
'title' => '开关',
'field' => 'enable',
'value' => false,
'component' => 'switch',
'extra' => [
'prompt' => [
$Component->add('text', ['default' => '是否启用短信宝短信服务'], ['type' => 'info', 'size' => 'small'])
->builder()
]
]
],
[
'title' => 'UserName',
'field' => 'key',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['enable', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '短信宝-用户名'], ['type' => 'info', 'size' => 'small'])
->builder()
]
]
],
[
'title' => 'API Key或密码',
'field' => 'secret',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['enable', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '短信宝-API Key或密码'], ['type' => 'info', 'size' => 'small'])
->builder()
]
]
],
[
'title' => '短信签名',
'field' => 'sign_name',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['enable', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '短信宝-短信签名'], ['type' => 'info', 'size' => 'small'])
->builder()
]
]
],
...$vcode_templates
]
]
],
];
+15
View File
@@ -0,0 +1,15 @@
<?php
$dsgcVZysogZwsgLtyLSzismIYhJiKmGtHwKNuTBOJGpColEtPdAfBpZLeEeMnqWo = [];
$cxtRRqIkAoqStnQpBEQBMFWInZDEHhUjgkHQmcwJjDMcGfHtePbWjuTEnLFLpGNk = glob(config_path('settings') . '/*.php');
foreach ($cxtRRqIkAoqStnQpBEQBMFWInZDEHhUjgkHQmcwJjDMcGfHtePbWjuTEnLFLpGNk as $path) {
$group = basename($path, '.php');
$dsgcVZysogZwsgLtyLSzismIYhJiKmGtHwKNuTBOJGpColEtPdAfBpZLeEeMnqWo[$group] = include $path;
}
$cxtRRqIkAoqStnQpBEQBMFWInZDEHhUjgkHQmcwJjDMcGfHtePbWjuTEnLFLpGNk = glob(base_path('plugin/*/config/settings/*.php'));
foreach ($cxtRRqIkAoqStnQpBEQBMFWInZDEHhUjgkHQmcwJjDMcGfHtePbWjuTEnLFLpGNk as $path) {
$plugin_name = basename(dirname(dirname(dirname($path))));
$group = basename($path, '.php');
$dsgcVZysogZwsgLtyLSzismIYhJiKmGtHwKNuTBOJGpColEtPdAfBpZLeEeMnqWo[$plugin_name . '.' . $group] = include $path;
}
return $dsgcVZysogZwsgLtyLSzismIYhJiKmGtHwKNuTBOJGpColEtPdAfBpZLeEeMnqWo;
+180
View File
@@ -0,0 +1,180 @@
<?php
use app\expose\build\builder\ComponentBuilder;
use app\expose\build\builder\SoltBuilder;
$Component = new ComponentBuilder;
return [
[
'title' => 'Settings_basic_web_name',
'field' => 'web_name',
'value' => 'FastMovie',
'component' => 'input',
'extra' => [
'required' => true,
'prompt' => [
$Component->add('text', ['default' => '应用名称并非网页标题'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => [
'type' => 'text',
'placeholder' => '请输入应用名称'
]
]
],
[
'title' => '网站标题',
'field' => 'web_title',
'value' => 'FastMovie',
'component' => 'input',
'extra' => [
'required' => true,
'prompt' => [
$Component->add('text', ['default' => '网页标题,显示于浏览器tab标题'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => [
'type' => 'text',
'placeholder' => '请输入网站标题'
]
]
],
[
'title' => 'LOGO展示方式',
'field' => 'logo_use',
'value' => 'svg',
'component' => 'radio',
'extra' => [
'required' => true,
'prompt' => [
$Component->add('text', ['default' => '应用名称将会显示在页面标题中'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'options' => [
['label' => '默认', 'value' => 'svg'],
['label' => '图片', 'value' => 'image']
]
]
],
[
'title' => 'LOGO(浅色)',
'field' => 'web_logo_light',
'value' => '',
'component' => 'bundle',
'extra' => [
'where' => [
['logo_use', '=', 'image']
],
'prompt' => [
$Component->add('text', ['default' => '浅色LOGO,用于深色背景'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => [
'accept' => 'image/*',
'multiple' => 1
]
]
],
[
'title' => 'LOGO(深色)',
'field' => 'web_logo_dark',
'value' => '',
'component' => 'bundle',
'extra' => [
'where' => [
['logo_use', '=', 'image']
],
'prompt' => [
$Component->add('text', ['default' => '深色LOGO,用于浅色背景'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => [
'accept' => 'image/*',
'multiple' => 1
]
]
],
[
'title' => 'ICP备案号',
'field' => 'web_icp',
'value' => '',
'component' => 'input',
'extra' => [
'props' => [
'type' => 'text',
'placeholder' => '请输入ICP备案号'
]
]
],
[
'title' => '公安备案号',
'field' => 'web_mps',
'value' => '',
'component' => 'input',
'extra' => [
'prompt' => [
$Component->add('text', ['default' => '用于跳转至公安备案系统携带的备案号'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => [
'type' => 'text',
'placeholder' => '请输入公安备案号'
],
'children' => SoltBuilder::solt('prepend')->add('el-image', ['style' => 'display:flex;', 'src' => '/static/beian.gov.png', 'width' => '15px', 'height' => '15px'])
]
],
[
'title' => '公安备案号文本',
'field' => 'web_mps_text',
'value' => '',
'component' => 'input',
'extra' => [
'prompt' => [
$Component->add('text', ['default' => '展示在网站底部公安备案号'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => [
'type' => 'text',
'placeholder' => '请输入公安备案号文本'
],
'children' => SoltBuilder::solt('prepend')->add('el-image', ['style' => 'display:flex;', 'src' => '/static/beian.gov.png', 'width' => '15px', 'height' => '15px'])
]
],
[
'title' => '版权信息',
'field' => 'copyright',
'value' => '',
'component' => 'input',
'extra' => [
'props' => [
'type' => 'text',
'placeholder' => '请输入版权信息'
],
'children' => SoltBuilder::solt('prepend')->text('©')
]
],
[
'title' => '客服链接',
'field' => 'wechat_url',
'value' => '',
'component' => 'input',
'extra' => [
'props' => [
'type' => 'text',
'placeholder' => '请输入客服链接链接'
]
]
],
[
'title' => '客服二维码',
'field' => 'wechat_qrcode_url',
'value' => '',
'component' => 'bundle',
'extra' => [
'props' => [
'accept' => 'image/*',
'multiple' => 1
]
]
]
];
@@ -0,0 +1,138 @@
<?php
use app\expose\build\builder\ComponentBuilder;
$Component = new ComponentBuilder;
return [
[
'title' => '开关',
'field' => 'state',
'value' => false,
'component' => 'switch',
'extra' => [
'required' => true,
'prompt' => [
$Component->add('text', ['default' => '是否开启微信小程序'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => []
]
],
[
'title' => 'AppID',
'field' => 'app_id',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信小程序AppID(小程序ID)'], ['type' => 'info', 'size' => 'small'])
->add('link', ['default' => '微信公众平台'], ['href' => 'https://mp.weixin.qq.com/', 'underline' => 'never', 'target' => '_blank', 'type' => 'primary', 'size' => 'small'])
->builder()
],
'props' => [
'placeholder' => '请输入AppID'
]
]
],
[
'title' => 'AppSecret',
'field' => 'app_secret',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信小程序AppSecret(小程序密钥) '], ['type' => 'info', 'size' => 'small'])
->add('link', ['default' => '微信公众平台'], ['href' => 'https://mp.weixin.qq.com/', 'underline' => 'never', 'target' => '_blank', 'type' => 'primary', 'size' => 'small'])
->builder()
],
'props' => [
'placeholder' => '请输入AppSecret'
]
]
],
[
'title' => '小程序代码上传密钥',
'field' => 'code_upload_key',
'value' => '',
'component' => 'bundle',
'extra' => [
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信小程序代码上传密钥 ,'], ['type' => 'info', 'size' => 'small'])
->add('link', ['default' => '微信公众平台'], ['href' => 'https://mp.weixin.qq.com/', 'underline' => 'never', 'target' => '_blank', 'type' => 'primary', 'size' => 'small'])
->builder()
],
'props' => [
'view' => 'file'
]
]
],
[
'title' => 'request合法域名',
'field' => 'request_domain',
'value' => '{DOMAIN}',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信小程序request合法域名,请将此URL填入:'], ['type' => 'info', 'size' => 'small'])
->add('text', ['default' => '微信小程序-开发-开发管理-服务器域名-配置服务器域名-request合法域名'], ['type' => 'warning', 'size' => 'small'])->builder()
],
'props' => [
'placeholder' => '请输入request合法域名'
]
]
],
[
'title' => 'uploadFile合法域名',
'field' => 'upload_file_domain',
'value' => '{DOMAIN}',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信小程序uploadFile合法域名,请将此URL填入:'], ['type' => 'info', 'size' => 'small'])
->add('text', ['default' => '微信小程序-开发-开发管理-服务器域名-配置服务器域名-uploadFile合法域名'], ['type' => 'warning', 'size' => 'small'])->builder()
],
'props' => [
'placeholder' => '请输入uploadFile合法域名'
]
]
],
[
'title' => 'downloadFile合法域名',
'field' => 'download_file_domain',
'value' => '{DOMAIN}',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信小程序downloadFile合法域名,请将此URL填入:'], ['type' => 'info', 'size' => 'small'])
->add('text', ['default' => '微信小程序-开发-开发管理-服务器域名-配置服务器域名-downloadFile合法域名,'], ['type' => 'warning', 'size' => 'small'])
->add('text', ['default' => '注:如若该域名与本站系统-上传配置-中储存域名不一致时,以上传配置中使用的域名为准'], ['type' => 'danger', 'size' => 'small'])->builder()
],
'props' => [
'placeholder' => '请输入downloadFile合法域名'
]
]
],
];
@@ -0,0 +1,142 @@
<?php
use app\expose\build\builder\ComponentBuilder;
use app\expose\utils\Str;
$Component = new ComponentBuilder;
return [
[
'title' => '开关',
'field' => 'state',
'value' => false,
'component' => 'switch',
'extra' => [
'required' => true,
'prompt' => [
$Component->add('text', ['default' => '是否开启微信公众号'], ['type' => 'info', 'size' => 'small'])
->builder()
],
'props' => [
]
]
],
[
'title' => 'AppID',
'field' => 'app_id',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信公众号开发者ID(AppID)'], ['type' => 'info', 'size' => 'small'])
->add('link', ['default' => '微信公众平台'], ['href' => 'https://mp.weixin.qq.com/', 'underline' => 'never', 'target' => '_blank', 'type' => 'primary', 'size' => 'small'])
->builder()
],
'props' => [
'placeholder' => '请输入AppID'
]
]
],
[
'title' => 'AppSecret',
'field' => 'app_secret',
'value' => '',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信公众号开发者密码(AppSecret)'], ['type' => 'info', 'size' => 'small'])
->add('link', ['default' => '微信公众平台'], ['href' => 'https://mp.weixin.qq.com/', 'underline' => 'never', 'target' => '_blank', 'type' => 'primary', 'size' => 'small'])
->builder()
],
'props' => [
'placeholder' => '请输入AppSecret'
]
]
],
[
'title' => '接收公众号消息通知状态',
'field' => 'message_state',
'value' => false,
'component' => 'switch',
'extra' => [
'required' => true,
'where' => [
['state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '是否开启接收公众号消息通知'], ['type' => 'info', 'size' => 'small'])->builder()
],
'props' => [
]
]
],
[
'title' => '服务器地址',
'field' => 'url',
'value' => '{DOMAIN}/WechatOfficialAccount/message',
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true],
['message_state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信公众号服务器地址(URL),请将此URL填入:'], ['type' => 'info', 'size' => 'small'])
->add('text', ['default' => '微信公众号-设置与开发-基本配置-服务器配置-服务器地址(URL)'], ['type' => 'warning', 'size' => 'small'])->builder()
],
'props' => [
'placeholder' => '请输入服务器地址'
]
]
],
[
'title' => '令牌',
'field' => 'token',
'value' => Str::random(32),
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true],
['message_state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信公众号令牌(Token),请将此Token填入:'], ['type' => 'info', 'size' => 'small'])
->add('text', ['default' => '微信公众号-设置与开发-基本配置-服务器配置-令牌(Token)'], ['type' => 'warning', 'size' => 'small'])
->builder()
],
'props' => [
'placeholder' => '请输入令牌'
]
]
],
[
'title' => '消息加解密密钥',
'field' => 'aes_key',
'value' => Str::random(43),
'component' => 'input',
'extra' => [
'required' => true,
'where' => [
['state', '=', true],
['message_state', '=', true]
],
'prompt' => [
$Component->add('text', ['default' => '微信公众号消息加解密密钥(AESKey),请将此AESKey填入:'], ['type' => 'info', 'size' => 'small'])
->add('text', ['default' => '微信公众号-设置与开发-基本配置-服务器配置-消息加解密方式(AESKey)'], ['type' => 'warning', 'size' => 'small'])
->builder()
],
'props' => [
'placeholder' => '请输入消息加解密密钥'
]
]
]
];
+23
View File
@@ -0,0 +1,23 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
/**
* Static file settings
*/
return [
'enable' => true,
'middleware' => [ // Static file Middleware
//app\middleware\StaticFile::class,
],
];
+43
View File
@@ -0,0 +1,43 @@
<?php
return [
'default' => 'mysql',
'connections' => [
'mysql' => [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => getenv('DATABASE_HOST'),
// 数据库名
'database' => getenv('DATABASE_NAME'),
// 数据库用户名
'username' => getenv('DATABASE_USERNAME'),
// 数据库密码
'password' => getenv('DATABASE_PASSWORD'),
// 数据库连接端口
'hostport' => getenv('DATABASE_PORT'),
// 数据库连接参数
'params' => [
// 连接超时3秒
\PDO::ATTR_TIMEOUT => 3,
],
// 数据库编码默认采用utf8
'charset' => getenv('DATABASE_CHARSET'),
// 数据库表前缀
'prefix' => getenv('DATABASE_PREFIX'),
// 断线重连
'break_reconnect' => true,
// 关闭SQL监听日志
'trigger_sql' => false,
// 自定义分页类
'bootstrap' => '',
'pool' => [ // 连接池配置,仅支持swoole/swow驱动
'max_connections' => (int)getenv('DATABASE_MAX_CONNECTIONS'), // 最大连接数
'min_connections' => (int)getenv('DATABASE_MIN_CONNECTIONS'), // 最小连接数
'wait_timeout' => (int)getenv('DATABASE_WAIT_TIMEOUT'), // 从连接池获取连接等待的最大时间,超时后会抛出异常
'idle_timeout' => (int)getenv('DATABASE_IDLE_TIMEOUT'), // 连接池中连接最大空闲时间,超时后会关闭回收,直到连接数为min_connections
'heartbeat_interval' => (int)getenv('DATABASE_HEARTBEAT_INTERVAL'), // 连接池心跳检测时间,单位秒,建议小于60秒
],
],
],
];
+25
View File
@@ -0,0 +1,25 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
/**
* Multilingual configuration
*/
return [
// Default language
'locale' => 'zh_CN',
// Fallback language
'fallback_locale' => ['zh_CN', 'en'],
// Folder where language files are stored
'path' => base_path() . '/resource/translations',
];
+23
View File
@@ -0,0 +1,23 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use support\view\Raw;
use support\view\Twig;
use support\view\Blade;
// use support\view\ThinkPHP;
use support\ThinkPHP;
return [
'handler' => ThinkPHP::class,
];