pref: 增加服务类优化UI版面

This commit is contained in:
Ying
2023-06-19 14:32:30 +08:00
parent 27eda6f37f
commit 2b8f874450
148 changed files with 3933 additions and 9286 deletions

View File

@@ -38,7 +38,7 @@ return [
'dispatch_success' => app_path() . '/admin/view/public/jumptpl.html',
'exception_tpl' => app_path() . '/admin/view/error/500.html',
'error_message' => '页面错误!请稍后再试~',
'version' => 'v1.1.6',
'version' => 'v1.1.7',
'cors_domain' => ['*', '127.0.0.1'],
'api_url' => 'https://api.swiftadmin.net/',
'show_error_msg' => false,

View File

@@ -12,9 +12,11 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use app\common\bootstrap\RedisCache;
return [
support\bootstrap\Session::class,
support\bootstrap\LaravelDb::class,
RedisCache::class, // 缓存服务器
Webman\ThinkOrm\ThinkOrm::class,
Webman\ThinkCache\ThinkCache::class,
];

View File

@@ -1,3 +0,0 @@
<?php
return [
];

View File

@@ -1,4 +1,4 @@
<?php
return [
'enable' => true,
'enable' => false,
];

View File

@@ -1,4 +1,4 @@
<?php
return [
'enable' => true,
'enable' => false,
];

View File

@@ -14,9 +14,11 @@
return [
'default' => [
'host' => '127.0.0.1',
'host' => get_env('CACHE_HOSTNAME') ?? '127.0.0.1',
'password' => get_env('REDIS_PASSWORD'),
'port' => 6379,
'database' => 1,
'port' => get_env('CACHE_HOSTPORT') ?? 6379,
'database' => get_env('CACHE_SELECT') ?? 0,
'prefix' => 'redis_',
'expire' => 0,
],
];

View File

@@ -14,16 +14,6 @@ use Webman\Route;
// 验证码路由
Route::any('/captcha', [app\BaseController::class, 'captcha']);
/**
* 加载自定义路由 [插件路由]
*/
$defineRoute = require __DIR__ . '/defineRoute.php';
if ($defineRoute && is_array($defineRoute)) {
foreach ($defineRoute as $key => $value) {
Route::any($key, $value);
}
}
/**
* 默认管理员路由
* @var string $manage
@@ -76,4 +66,30 @@ Route::fallback(function ($request) {
}
return response(request_error(current($parseApp)), 404);
});
});
// 执行插件初始化
$pluginList = get_plugin_list();
foreach ($pluginList as $item) {
if (!$item['status']) {
continue;
}
foreach ($item['rewrite'] as $route => $value) {
$separator = explode('/', $value);
$method = end($separator);
array_pop($separator);
$filePath = implode('\\', $separator);
$controller = 'app\\index\\controller\\' . $filePath;
if (class_exists($controller) && method_exists($controller, $method)) {
try {
$classFullName = (new ReflectionClass($controller))->getName();
Route::any($route, [$classFullName, $method]);
} catch (\Throwable $e) {
var_dump('error: ' . $e->getMessage());
}
} else {
var_dump("\033[31m$controller or $method does not exist!\033[0m");
}
}
}

View File

@@ -1,3 +0,0 @@
<?php
return [
];

View File

@@ -1,24 +0,0 @@
<?php
return [
'default' => get_env('CACHE_DRIVER') ?: 'file',
'stores' => [
'file' => [
'type' => 'File',
// 缓存保存目录
'path' => runtime_path() . '/cache/',
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
],
'redis' => [
'type' => 'redis',
'host' => get_env('CACHE_HOSTNAME') ?: '127.0.0.1',
'port' => get_env('CACHE_HOSTPORT') ?: 6379,
'select' => get_env('CACHE_SELECT') ?: 0,
'password' => get_env('CACHE_PASSWORD') ?: '',
'prefix' => 'redis_',
'expire' => 0,
],
],
];

View File

@@ -25,7 +25,9 @@ return [
// 断线重连
'break_reconnect' => true,
// 关闭SQL监听日志
'trigger_sql' => false,
'trigger_sql' => true,
// 开启字段缓存
'fields_cache' => false,
],
],
];

View File

@@ -23,7 +23,7 @@ return [
'tpl_cache' => true,
'taglib_begin' => '<',
'taglib_end' => '>',
'taglib_pre_load' => implode(',', array_merge(['app\common\taglib\SaLibs'],include __DIR__ . '/taglib.php')),
'taglib_pre_load' => 'app\common\taglib\SaLibs',
'tpl_replace_string' => [
'__STATIC__' => '/static/',
'__STATICJS__' => '/static/js/',