Compare commits
2 Commits
89d7761887
...
743d8d9ddf
| Author | SHA1 | Date | |
|---|---|---|---|
| 743d8d9ddf | |||
| aa2612bcb9 |
100
REDIS_SETUP.md
100
REDIS_SETUP.md
@ -1,100 +0,0 @@
|
||||
# Redis 配置说明
|
||||
|
||||
## 1. 安装 Redis 扩展
|
||||
|
||||
在项目根目录执行:
|
||||
|
||||
```bash
|
||||
composer require predis/predis
|
||||
```
|
||||
|
||||
或者如果使用 phpredis 扩展(需要 PHP Redis 扩展):
|
||||
|
||||
```bash
|
||||
# 确保已安装 PHP Redis 扩展
|
||||
# 然后直接使用,无需 composer 安装
|
||||
```
|
||||
|
||||
## 2. 配置环境变量
|
||||
|
||||
在项目根目录创建 `.env` 文件(如果不存在),添加以下配置:
|
||||
|
||||
```env
|
||||
# Redis 配置
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PORT=6379
|
||||
REDIS_PASSWORD=
|
||||
REDIS_DB=0
|
||||
REDIS_PREFIX=
|
||||
|
||||
# 缓存配置
|
||||
CACHE_DRIVER=redis
|
||||
|
||||
# Session 配置
|
||||
SESSION_DRIVER=redis
|
||||
SESSION_PREFIX=
|
||||
```
|
||||
|
||||
## 3. 配置文件说明
|
||||
|
||||
### cache.php
|
||||
- 默认缓存驱动已设置为 `redis`
|
||||
- Redis 连接配置已添加
|
||||
|
||||
### session.php
|
||||
- Session 驱动已设置为 `redis`
|
||||
- 使用 Redis 存储 Session
|
||||
|
||||
## 4. 使用说明
|
||||
|
||||
### 缓存使用
|
||||
```php
|
||||
use think\facade\Cache;
|
||||
|
||||
// 设置缓存
|
||||
Cache::set('key', 'value', 3600);
|
||||
|
||||
// 获取缓存
|
||||
$value = Cache::get('key');
|
||||
|
||||
// 删除缓存
|
||||
Cache::delete('key');
|
||||
```
|
||||
|
||||
### Session 使用
|
||||
```php
|
||||
use think\facade\Session;
|
||||
|
||||
// 设置 Session
|
||||
Session::set('key', 'value');
|
||||
|
||||
// 获取 Session
|
||||
$value = Session::get('key');
|
||||
```
|
||||
|
||||
## 5. 验证 Redis 连接
|
||||
|
||||
确保 Redis 服务已启动:
|
||||
|
||||
```bash
|
||||
# Windows
|
||||
redis-server
|
||||
|
||||
# Linux/Mac
|
||||
sudo systemctl start redis
|
||||
# 或
|
||||
redis-server
|
||||
```
|
||||
|
||||
测试连接:
|
||||
```bash
|
||||
redis-cli ping
|
||||
# 应该返回 PONG
|
||||
```
|
||||
|
||||
## 6. 注意事项
|
||||
|
||||
1. 如果 Redis 未安装或连接失败,可以临时将 `CACHE_DRIVER` 和 `SESSION_DRIVER` 改回 `file`
|
||||
2. Redis 密码如果为空,可以不设置 `REDIS_PASSWORD`
|
||||
3. `REDIS_PREFIX` 用于区分不同项目的缓存,建议设置
|
||||
|
||||
@ -14,7 +14,7 @@ use app\model\FrontMenu;
|
||||
|
||||
class FrontMenuController extends BaseController
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* 获取前端导航接口
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
@ -163,7 +163,7 @@ class FrontMenuController extends BaseController
|
||||
} catch (DbException $e) {
|
||||
// 记录失败日志
|
||||
$this->logFail('前端导航管理', '更新前端导航', $e->getMessage());
|
||||
return json([
|
||||
return json([
|
||||
'code' => 500,
|
||||
'msg' => 'fail:' . $e->getMessage(),
|
||||
'data' => $e->getTraceAsString()
|
||||
@ -176,7 +176,7 @@ class FrontMenuController extends BaseController
|
||||
{
|
||||
try {
|
||||
// 检查是否有子前端导航
|
||||
$hasChildren = FrontMenu::where('pid', $id)
|
||||
$hasChildren = FrontMenu::where('pid', $id)
|
||||
->where('pid', $id)
|
||||
->where('delete_time', null)
|
||||
->count() > 0;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\index\controller\Article;
|
||||
|
||||
@ -16,17 +17,19 @@ use think\db\exception\DbException;
|
||||
class ArticleController extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取新闻中心顶部4篇文章
|
||||
* 获取技术中心顶部4篇文章
|
||||
* @return Json
|
||||
*/
|
||||
public function getNewsCenterTop4(): Json
|
||||
{
|
||||
try {
|
||||
// 1. 查询新闻中心主分类
|
||||
$newsCenterCategory = ArticlesCategory::where('name', '新闻中心')
|
||||
// 1. 查询技术中心主分类
|
||||
$newsCenterCategory = ArticlesCategory::where('name', '技术中心')
|
||||
->where('delete_time', null)
|
||||
->find();
|
||||
|
||||
|
||||
var_dump($newsCenterCategory);
|
||||
|
||||
if (!$newsCenterCategory) {
|
||||
return json([
|
||||
'code' => 200,
|
||||
@ -34,18 +37,18 @@ class ArticleController extends BaseController
|
||||
'list' => [],
|
||||
]);
|
||||
}
|
||||
|
||||
// 2. 获取新闻中心及其子分类的ID列表
|
||||
|
||||
// 2. 获取技术中心及其子分类的ID列表
|
||||
$mainCategoryId = $newsCenterCategory['id'];
|
||||
|
||||
|
||||
// 查询子分类
|
||||
$subCategories = ArticlesCategory::where('cid', $mainCategoryId)
|
||||
->where('delete_time', null)
|
||||
->column('id');
|
||||
|
||||
|
||||
// 合并主分类和子分类ID
|
||||
$categoryIds = array_merge([$mainCategoryId], $subCategories);
|
||||
|
||||
|
||||
if (empty($categoryIds)) {
|
||||
return json([
|
||||
'code' => 200,
|
||||
@ -53,7 +56,7 @@ class ArticleController extends BaseController
|
||||
'list' => [],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
// 3. 查询符合条件的文章,按指定优先级排序,取最新4篇
|
||||
$articles = Articles::published()
|
||||
->whereIn('cate', $categoryIds)
|
||||
@ -75,7 +78,7 @@ class ArticleController extends BaseController
|
||||
])
|
||||
->limit(4)
|
||||
->select();
|
||||
|
||||
|
||||
// 4. 处理文章数据,去除HTML标签并生成desc字段
|
||||
foreach ($articles as &$article) {
|
||||
// 使用PHP的strip_tags函数去除HTML标签,然后截取前100个字符
|
||||
@ -83,7 +86,7 @@ class ArticleController extends BaseController
|
||||
// 移除原始content字段,减少返回数据大小
|
||||
unset($article['content']);
|
||||
}
|
||||
|
||||
|
||||
return json([
|
||||
'code' => 200,
|
||||
'msg' => 'success',
|
||||
@ -92,10 +95,10 @@ class ArticleController extends BaseController
|
||||
} catch (\Exception $e) {
|
||||
// 打印完整错误信息到日志
|
||||
$errorMsg = '错误信息:' . $e->getMessage() . ' | 错误行号:' . $e->getLine() . ' | 执行SQL:' . Articles::getLastSql();
|
||||
trace('新闻中心文章查询失败: ' . $errorMsg, 'error');
|
||||
trace('技术中心文章查询失败: ' . $errorMsg, 'error');
|
||||
return json([
|
||||
'code' => 500,
|
||||
'msg' => '新闻中心文章查询失败,请稍后重试',
|
||||
'msg' => '技术中心文章查询失败,请稍后重试',
|
||||
'list' => []
|
||||
]);
|
||||
}
|
||||
@ -118,7 +121,7 @@ class ArticleController extends BaseController
|
||||
|
||||
try {
|
||||
$article = Articles::where('id', $id)->where('delete_time', null)->find();
|
||||
|
||||
|
||||
if (!$article) {
|
||||
return json([
|
||||
'code' => 404,
|
||||
@ -164,7 +167,7 @@ class ArticleController extends BaseController
|
||||
|
||||
try {
|
||||
$article = Articles::where('id', $id)->where('delete_time', null)->find();
|
||||
|
||||
|
||||
if (!$article) {
|
||||
return json([
|
||||
'code' => 404,
|
||||
@ -210,15 +213,15 @@ class ArticleController extends BaseController
|
||||
|
||||
try {
|
||||
$article = Articles::where('id', $id)->where('delete_time', null)->find();
|
||||
|
||||
|
||||
if (!$article) {
|
||||
return json([
|
||||
'code' => 404,
|
||||
'msg' => '文章不存在',
|
||||
'list' => []
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($article->likes <= 0) {
|
||||
return json([
|
||||
'code' => 400,
|
||||
@ -226,10 +229,10 @@ class ArticleController extends BaseController
|
||||
'list' => []
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$article->dec('likes');
|
||||
$article->save();
|
||||
|
||||
|
||||
return json([
|
||||
'code' => 200,
|
||||
'msg' => '取消点赞成功',
|
||||
@ -246,4 +249,4 @@ class ArticleController extends BaseController
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,12 +9,56 @@ use app\index\BaseController;
|
||||
use app\model\FrontMenu;
|
||||
use app\model\OnePage;
|
||||
use think\db\exception\DbException;
|
||||
use think\facade\Env;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return '您好!这是一个[index]示例应用';
|
||||
return view('index/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日志列表
|
||||
*/
|
||||
public function getLogs()
|
||||
{
|
||||
$logPath = Env::get('runtime_path') . 'log/';
|
||||
$logs = [];
|
||||
|
||||
// 读取最近的日志文件
|
||||
$files = glob($logPath . '*.log');
|
||||
if ($files) {
|
||||
// 按修改时间排序,最新的在前
|
||||
usort($files, function($a, $b) {
|
||||
return filemtime($b) - filemtime($a);
|
||||
});
|
||||
|
||||
// 读取最新的日志文件
|
||||
$latestFile = reset($files);
|
||||
if (file_exists($latestFile)) {
|
||||
$content = file_get_contents($latestFile);
|
||||
$lines = explode("\n", $content);
|
||||
|
||||
// 倒序遍历,只取最近的100条
|
||||
$count = 0;
|
||||
for ($i = count($lines) - 1; $i >= 0 && $count < 100; $i--) {
|
||||
if (!empty(trim($lines[$i]))) {
|
||||
$logs[] = $lines[$i];
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
// 再倒序回来,使最新的日志在最后
|
||||
$logs = array_reverse($logs);
|
||||
}
|
||||
}
|
||||
|
||||
return json([
|
||||
'code' => 200,
|
||||
'msg' => 'success',
|
||||
'data' => $logs
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -24,4 +24,8 @@ Route::post('articleUnlikes/:id', 'app\index\controller\Article\ArticleControlle
|
||||
|
||||
// --- 前端导航与单页路由 ---
|
||||
Route::get('headmenu', 'app\index\controller\Index@getHeadMenu');
|
||||
Route::rule('onepage/:path', 'app\index\controller\Index@getOnePageByPath', 'GET')->pattern(['path' => '.*']);
|
||||
Route::rule('onepage/:path', 'app\index\controller\Index@getOnePageByPath', 'GET')->pattern(['path' => '.*']);
|
||||
|
||||
// --- 日志相关路由 ---
|
||||
Route::get('index/getLogs', 'app\index\controller\Index@getLogs');
|
||||
Route::get('getLogs', 'app\index\controller\Index@getLogs');
|
||||
104
app/index/view/index/index.html
Normal file
104
app/index/view/index/index.html
Normal file
@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>后端运行状态</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 20px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
p {
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
#log-content {
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
padding: 20px;
|
||||
margin: 20px auto;
|
||||
max-width: 1200px;
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
#log-content div {
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
font-size: 14px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
#log-content div:hover {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
#log-content p {
|
||||
text-align: left;
|
||||
}
|
||||
.refresh-info {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>后端服务运行状态</h1>
|
||||
<p>实时监控系统运行情况</p>
|
||||
<div id="log-content">
|
||||
<p>正在加载日志...</p>
|
||||
</div>
|
||||
<div class="refresh-info">
|
||||
<span id="last-refresh">最后刷新: 从未</span>
|
||||
<span> | </span>
|
||||
<span>每5秒自动刷新</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 加载日志
|
||||
function loadLogs() {
|
||||
fetch('/getLogs')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const logContent = document.getElementById('log-content');
|
||||
if (data.code === 200) {
|
||||
logContent.innerHTML = '';
|
||||
if (data.data && data.data.length > 0) {
|
||||
data.data.forEach(log => {
|
||||
const logItem = document.createElement('div');
|
||||
logItem.textContent = log;
|
||||
logContent.appendChild(logItem);
|
||||
});
|
||||
} else {
|
||||
logContent.innerHTML = '<p>暂无日志记录</p>';
|
||||
}
|
||||
} else {
|
||||
logContent.innerHTML = '<p>加载日志失败: ' + (data.msg || '未知错误') + '</p>';
|
||||
}
|
||||
|
||||
// 更新最后刷新时间
|
||||
const now = new Date();
|
||||
const timeStr = now.toLocaleString('zh-CN');
|
||||
document.getElementById('last-refresh').textContent = '最后刷新: ' + timeStr;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('加载日志失败:', error);
|
||||
const logContent = document.getElementById('log-content');
|
||||
logContent.innerHTML = '<p>加载日志失败: 网络错误</p>';
|
||||
});
|
||||
}
|
||||
|
||||
// 初始加载日志
|
||||
loadLogs();
|
||||
|
||||
// 定时刷新日志,每5秒一次
|
||||
setInterval(loadLogs, 5000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
283
composer.lock
generated
283
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "f2fe151df908712821797af0035e9769",
|
||||
"content-hash": "ca7c2e934d0d1625582732e674763e2b",
|
||||
"packages": [
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
@ -374,16 +374,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
"version": "1.1",
|
||||
"version": "2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-message.git",
|
||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
|
||||
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -392,7 +392,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -407,7 +407,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP messages",
|
||||
@ -421,9 +421,9 @@
|
||||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-message/tree/1.1"
|
||||
"source": "https://github.com/php-fig/http-message/tree/2.0"
|
||||
},
|
||||
"time": "2023-04-04T09:50:52+00:00"
|
||||
"time": "2023-04-04T09:54:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
@ -526,103 +526,18 @@
|
||||
},
|
||||
"time": "2021-10-29T13:26:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.33.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-iconv": "*",
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/nicolas-grekas",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-23T08:48:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/framework",
|
||||
"version": "v8.1.3",
|
||||
"version": "v8.1.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/framework.git",
|
||||
"reference": "e4207e98b66f92d26097ed6efd535930cba90e8f"
|
||||
"reference": "8e7b2b2364047cbf71a38c4e397a9ca0d4ef2b01"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/e4207e98b66f92d26097ed6efd535930cba90e8f",
|
||||
"reference": "e4207e98b66f92d26097ed6efd535930cba90e8f",
|
||||
"url": "https://api.github.com/repos/top-think/framework/zipball/8e7b2b2364047cbf71a38c4e397a9ca0d4ef2b01",
|
||||
"reference": "8e7b2b2364047cbf71a38c4e397a9ca0d4ef2b01",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -630,7 +545,7 @@
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"php": ">=8.0.0",
|
||||
"psr/http-message": "^1.0",
|
||||
"psr/http-message": "^1.0|^2.0",
|
||||
"psr/log": "^1.0|^2.0|^3.0",
|
||||
"psr/simple-cache": "^1.0|^2.0|^3.0",
|
||||
"topthink/think-container": "^3.0",
|
||||
@ -639,6 +554,7 @@
|
||||
"topthink/think-validate": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.92",
|
||||
"guzzlehttp/psr7": "^2.1.0",
|
||||
"mikey179/vfsstream": "^1.6",
|
||||
"mockery/mockery": "^1.2",
|
||||
@ -674,9 +590,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/framework/issues",
|
||||
"source": "https://github.com/top-think/framework/tree/v8.1.3"
|
||||
"source": "https://github.com/top-think/framework/tree/v8.1.4"
|
||||
},
|
||||
"time": "2025-07-14T03:48:44+00:00"
|
||||
"time": "2026-01-15T02:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-container",
|
||||
@ -724,56 +640,6 @@
|
||||
},
|
||||
"time": "2025-04-07T03:21:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-cors",
|
||||
"version": "v1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-cors.git",
|
||||
"reference": "822d90b357daa5aa5e1d01668615599f428ad132"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-cors/zipball/822d90b357daa5aa5e1d01668615599f428ad132",
|
||||
"reference": "822d90b357daa5aa5e1d01668615599f428ad132",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"topthink/framework": "^6.0|^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
"config": {
|
||||
"cors": "src/config.php"
|
||||
},
|
||||
"services": [
|
||||
"think\\cors\\Service"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"think\\cors\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "yunwuxin",
|
||||
"email": "448901948@qq.com"
|
||||
}
|
||||
],
|
||||
"description": "The Cors Library For ThinkPHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/think-cors/issues",
|
||||
"source": "https://github.com/top-think/think-cors/tree/v1.0.2"
|
||||
},
|
||||
"time": "2024-04-26T06:32:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-filesystem",
|
||||
"version": "v2.0.3",
|
||||
@ -1090,17 +956,102 @@
|
||||
"time": "2024-09-25T14:21:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v6.4.26",
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.33.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "cfae1497a2f1eaad78dbc0590311c599c7178d4a"
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/cfae1497a2f1eaad78dbc0590311c599c7178d4a",
|
||||
"reference": "cfae1497a2f1eaad78dbc0590311c599c7178d4a",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-iconv": "*",
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/nicolas-grekas",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-23T08:48:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v6.4.32",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "131fc9915e0343052af5ed5040401b481ca192aa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/131fc9915e0343052af5ed5040401b481ca192aa",
|
||||
"reference": "131fc9915e0343052af5ed5040401b481ca192aa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1155,7 +1106,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v6.4.26"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v6.4.32"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1175,20 +1126,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-25T15:37:27+00:00"
|
||||
"time": "2026-01-01T13:34:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-dumper",
|
||||
"version": "v1.0.5",
|
||||
"version": "v1.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-dumper.git",
|
||||
"reference": "eba662a1843d5db68059050c530f7d43287289fc"
|
||||
"reference": "2140ea8293d1a27637ada9b830078b8a1e0f44b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/top-think/think-dumper/zipball/eba662a1843d5db68059050c530f7d43287289fc",
|
||||
"reference": "eba662a1843d5db68059050c530f7d43287289fc",
|
||||
"url": "https://api.github.com/repos/top-think/think-dumper/zipball/2140ea8293d1a27637ada9b830078b8a1e0f44b3",
|
||||
"reference": "2140ea8293d1a27637ada9b830078b8a1e0f44b3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1221,9 +1172,9 @@
|
||||
"description": "Dumper extend for thinkphp",
|
||||
"support": {
|
||||
"issues": "https://github.com/top-think/think-dumper/issues",
|
||||
"source": "https://github.com/top-think/think-dumper/tree/v1.0.5"
|
||||
"source": "https://github.com/top-think/think-dumper/tree/v1.0.6"
|
||||
},
|
||||
"time": "2025-03-21T07:15:45+00:00"
|
||||
"time": "2026-01-14T08:50:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-trace",
|
||||
@ -1286,5 +1237,5 @@
|
||||
"php": ">=8.0.0"
|
||||
},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
"plugin-api-version": "2.9.0"
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ return [
|
||||
// 是否启用路由
|
||||
'with_route' => true,
|
||||
// 默认应用
|
||||
'default_app' => 'admin',
|
||||
'default_app' => 'index',
|
||||
// 默认时区
|
||||
'default_timezone' => 'Asia/Shanghai',
|
||||
// 自动多应用模式
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 模板引擎类型使用Think
|
||||
'type' => 'Think',
|
||||
// 模板引擎类型使用php
|
||||
'type' => 'php',
|
||||
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
|
||||
'auto_rule' => 1,
|
||||
// 模板目录名
|
||||
|
||||
Loading…
Reference in New Issue
Block a user