初始化-安装依赖
This commit is contained in:
10
server/plugin/saipackage/config/app.php
Normal file
10
server/plugin/saipackage/config/app.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
use support\Request;
|
||||
|
||||
return [
|
||||
'debug' => true,
|
||||
'controller_suffix' => 'Controller',
|
||||
'controller_reuse' => false,
|
||||
'version' => '6.0.1'
|
||||
];
|
||||
6
server/plugin/saipackage/config/autoload.php
Normal file
6
server/plugin/saipackage/config/autoload.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
return [
|
||||
'files' => [
|
||||
base_path() . '/plugin/saipackage/app/functions.php',
|
||||
]
|
||||
];
|
||||
2
server/plugin/saipackage/config/container.php
Normal file
2
server/plugin/saipackage/config/container.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
return new Webman\Container;
|
||||
2
server/plugin/saipackage/config/database.php
Normal file
2
server/plugin/saipackage/config/database.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
return [];
|
||||
5
server/plugin/saipackage/config/exception.php
Normal file
5
server/plugin/saipackage/config/exception.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'' => \plugin\saiadmin\app\exception\Handler::class,
|
||||
];
|
||||
20
server/plugin/saipackage/config/log.php
Normal file
20
server/plugin/saipackage/config/log.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'default' => [
|
||||
'handlers' => [
|
||||
[
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
'constructor' => [
|
||||
runtime_path() . '/logs/saipackage.log',
|
||||
7,
|
||||
Monolog\Logger::DEBUG,
|
||||
],
|
||||
'formatter' => [
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
];
|
||||
6
server/plugin/saipackage/config/middleware.php
Normal file
6
server/plugin/saipackage/config/middleware.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'' => [
|
||||
]
|
||||
];
|
||||
2
server/plugin/saipackage/config/process.php
Normal file
2
server/plugin/saipackage/config/process.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
return [];
|
||||
14
server/plugin/saipackage/config/route.php
Normal file
14
server/plugin/saipackage/config/route.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
use Webman\Route;
|
||||
|
||||
Route::group('/tool/install', function () {
|
||||
// 商店代理接口(在线安装)
|
||||
Route::get('/online/appList', [plugin\saipackage\app\controller\InstallController::class, 'appList']);
|
||||
Route::get('/online/storeCaptcha', [plugin\saipackage\app\controller\InstallController::class, 'storeCaptcha']);
|
||||
Route::post('/online/storeLogin', [plugin\saipackage\app\controller\InstallController::class, 'storeLogin']);
|
||||
Route::get('/online/storeUserInfo', [plugin\saipackage\app\controller\InstallController::class, 'storeUserInfo']);
|
||||
Route::get('/online/storePurchasedApps', [plugin\saipackage\app\controller\InstallController::class, 'storePurchasedApps']);
|
||||
Route::get('/online/storeAppVersions', [plugin\saipackage\app\controller\InstallController::class, 'storeAppVersions']);
|
||||
Route::post('/online/storeDownloadApp', [plugin\saipackage\app\controller\InstallController::class, 'storeDownloadApp']);
|
||||
});
|
||||
6
server/plugin/saipackage/config/static.php
Normal file
6
server/plugin/saipackage/config/static.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'middleware' => [], // Static file Middleware
|
||||
];
|
||||
79
server/plugin/saipackage/config/terminal.php
Normal file
79
server/plugin/saipackage/config/terminal.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// 允许执行的命令
|
||||
'commands' => [
|
||||
// 查看版本的命令
|
||||
'version' => [
|
||||
'npm' => 'npm -v',
|
||||
'yarn' => 'yarn -v',
|
||||
'pnpm' => 'pnpm -v',
|
||||
'node' => 'node -v',
|
||||
],
|
||||
// 测试命令
|
||||
'test' => [
|
||||
'npm' => [
|
||||
'cwd' => public_path() . DIRECTORY_SEPARATOR . 'npm-install-test',
|
||||
'command' => 'npm install',
|
||||
],
|
||||
'yarn' => [
|
||||
'cwd' => public_path() . DIRECTORY_SEPARATOR . 'npm-install-test',
|
||||
'command' => 'yarn install',
|
||||
],
|
||||
'pnpm' => [
|
||||
'cwd' => public_path() . DIRECTORY_SEPARATOR . 'npm-install-test',
|
||||
'command' => 'pnpm install',
|
||||
],
|
||||
],
|
||||
// 安装 WEB 依赖包
|
||||
'web-install' => [
|
||||
'npm' => [
|
||||
'cwd' => dirname(base_path()) . DIRECTORY_SEPARATOR . env('FRONTEND_DIR', 'saiadmin-artd'),
|
||||
'command' => 'npm install',
|
||||
],
|
||||
'yarn' => [
|
||||
'cwd' => dirname(base_path()) . DIRECTORY_SEPARATOR . env('FRONTEND_DIR', 'saiadmin-artd'),
|
||||
'command' => 'yarn install',
|
||||
],
|
||||
'pnpm' => [
|
||||
'cwd' => dirname(base_path()) . DIRECTORY_SEPARATOR . env('FRONTEND_DIR', 'saiadmin-artd'),
|
||||
'command' => 'pnpm install',
|
||||
],
|
||||
],
|
||||
// 构建 WEB 端
|
||||
'web-build' => [
|
||||
'npm' => [
|
||||
'cwd' => dirname(base_path()) . DIRECTORY_SEPARATOR . env('FRONTEND_DIR', 'saiadmin-artd'),
|
||||
'command' => 'npm run build',
|
||||
],
|
||||
'yarn' => [
|
||||
'cwd' => dirname(base_path()) . DIRECTORY_SEPARATOR . env('FRONTEND_DIR', 'saiadmin-artd'),
|
||||
'command' => 'yarn run build',
|
||||
],
|
||||
'pnpm' => [
|
||||
'cwd' => dirname(base_path()) . DIRECTORY_SEPARATOR . env('FRONTEND_DIR', 'saiadmin-artd'),
|
||||
'command' => 'pnpm run build',
|
||||
],
|
||||
],
|
||||
// 设置 NPM 源
|
||||
'set-npm-registry' => [
|
||||
'npm' => 'npm config set registry https://registry.npmjs.org/ && npm config get registry',
|
||||
'taobao' => 'npm config set registry https://registry.npmmirror.com/ && npm config get registry',
|
||||
'tencent' => 'npm config set registry https://mirrors.cloud.tencent.com/npm/ && npm config get registry'
|
||||
],
|
||||
// 设置 composer 源
|
||||
'set-composer-registry' => [
|
||||
'composer' => 'composer config --unset repos.packagist',
|
||||
'tencent' => 'composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/',
|
||||
'huawei' => 'composer config -g repos.packagist composer https://mirrors.huaweicloud.com/repository/php/',
|
||||
'kkame' => 'composer config -g repos.packagist composer https://packagist.kr',
|
||||
],
|
||||
// 安装 composer 包
|
||||
'composer' => [
|
||||
'update' => [
|
||||
'cwd' => base_path(),
|
||||
'command' => 'composer update --no-interaction',
|
||||
],
|
||||
]
|
||||
],
|
||||
];
|
||||
10
server/plugin/saipackage/config/translation.php
Normal file
10
server/plugin/saipackage/config/translation.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// Default language
|
||||
'locale' => 'zh_CN',
|
||||
// Fallback language
|
||||
'fallback_locale' => ['zh_CN', 'en'],
|
||||
// Folder where language files are stored
|
||||
'path' => base_path() . "/plugin/saipackage/resource/translations",
|
||||
];
|
||||
5
server/plugin/saipackage/config/upload.php
Normal file
5
server/plugin/saipackage/config/upload.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return [
|
||||
'type' => ['zip'],
|
||||
'size' => 1024 * 1024 * 5, // 5MB
|
||||
];
|
||||
10
server/plugin/saipackage/config/view.php
Normal file
10
server/plugin/saipackage/config/view.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
use support\view\Raw;
|
||||
use support\view\Twig;
|
||||
use support\view\Blade;
|
||||
use support\view\ThinkPHP;
|
||||
|
||||
return [
|
||||
'handler' => Raw::class
|
||||
];
|
||||
Reference in New Issue
Block a user