chore(repo): 初始化 v8 项目基础配置

将 v8 分支需要的仓库级配置、Composer 依赖、CI 脚本和入口文件一次性整理到目标仓库。

主要内容:

- 更新 composer.json,切换到 v8 插件化依赖与本地 path 仓库。

- 同步 .gitignore、代码风格、发布脚本和 GitHub Actions 配置。

- 调整 config、think、public 入口和默认 index 控制器以适配 v8 运行结构。

- 清理 v6 遗留的根级 license/security 文件,由组件文档和仓库说明统一承载。
This commit is contained in:
Anyon 2026-05-08 15:30:32 +08:00
parent 25aec0cf8a
commit f891251e54
33 changed files with 1031 additions and 454 deletions

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{php,js,css,html,json,xml,yml,yaml,md,txt}]
indent_style = space
indent_size = 4

View File

@ -14,10 +14,3 @@ CACHE_REDIS_HOST=127.0.0.1
CACHE_REDIS_PORT=6379 CACHE_REDIS_PORT=6379
CACHE_REDIS_SELECT= CACHE_REDIS_SELECT=
CACHE_REDIS_PASSWORD= CACHE_REDIS_PASSWORD=
# 会话配置
SESSION_TYPE=file
SESSION_NAME=ssid
SESSION_STORE=
SESSION_EXPIRE=7200
SESSION_PREFIX=

21
.github/clear-github-releases.py vendored Normal file
View File

@ -0,0 +1,21 @@
import os
from github import Github
def delete_all_releases(repo):
for release in repo.get_releases():
try:
release.delete_release()
print(f"Deleted release: {release.title}")
except Exception as e:
print(f"Failed to delete release {release.title}: {e}")
def main():
token = os.getenv("GITHUB_TOKEN")
repo_name = os.getenv("GITHUB_REPOSITORY").split('/')[-1] # 获取仓库名
owner = os.getenv("GITHUB_REPOSITORY").split('/')[0] # 获取仓库所有者
g = Github(token)
repo = g.get_repo(f"{owner}/{repo_name}")
delete_all_releases(repo)
if __name__ == "__main__":
main()

13
.github/clear-github-tags.cmd vendored Normal file
View File

@ -0,0 +1,13 @@
@echo off
setlocal
git pull
echo Deleting remote tags...
for /f "delims=" %%x in ('git tag') do git push --delete origin %%x
echo Deleting local tags...
for /f "delims=" %%i in ('git tag') do git tag -d %%i
echo All tags deleted.
pause

47
.github/release.sh vendored Normal file
View File

@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -e
if (( "$#" == 0 ))
then
echo "Tag has to be provided"
exit 1
fi
NOW=$(date +%s)
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
VERSION=$1
BASEPATH=$(cd `dirname $0`; cd ../plugin/; pwd)
if [ -z $2 ] ; then
repos=$(ls $BASEPATH)
else
repos=${@:2}
fi
for REMOTE in $repos
do
echo ""
echo ""
echo "Cloning $REMOTE";
TMP_DIR="/tmp/ThinkAdminSplit"
REMOTE_URL="git@github.com:zoujingli/$REMOTE.git"
rm -rf $TMP_DIR;
mkdir $TMP_DIR;
(
cd $TMP_DIR;
git clone $REMOTE_URL .
git checkout "$CURRENT_BRANCH";
if [[ $(git log --pretty="%d" -n 1 | grep tag --count) -eq 0 ]]; then
echo "Releasing $REMOTE"
git tag $VERSION
git push origin --tags
fi
)
done
TIME=$(echo "$(date +%s) - $NOW" | bc)
printf "Execution time: %f seconds" $TIME

27
.github/split-linux.sh vendored Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
set -x
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
BASEPATH=$(cd `dirname $0`; cd ../plugin/; pwd)
REPOS=$@
function split()
{
SHA1=`.github/splitsh-lite-linux --prefix=$1`
git push $2 "$SHA1:refs/heads/$CURRENT_BRANCH" -f
}
function remote()
{
git remote add $1 $2 || true
}
git pull origin $CURRENT_BRANCH
if [[ $# -eq 0 ]]; then
REPOS=$(ls $BASEPATH)
fi
for REPO in $REPOS ; do
remote $REPO git@github.com:zoujingli/$REPO.git
split "plugin/$REPO" $REPO
done

BIN
.github/splitsh-lite-linux vendored Executable file

Binary file not shown.

33
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: CI
on:
push:
branches:
- '**'
tags:
- 'v*'
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: bcmath, curl, gd, mbstring, openssl
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Run tests
run: composer test
- name: Run static analysis
run: composer analyse

26
.github/workflows/clear.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Clear Releases
on:
workflow_dispatch:
jobs:
delete:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies and run script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m pip install --upgrade pip
pip install PyGithub
python .github/clear-github-releases.py

View File

@ -1,14 +1,51 @@
####### 可解析的提交前缀 ########
# ci: 持续集成
# fix: 修改
# feat: 新增
# refactor: 重构
# docs: 文档
# style: 样式
# chore: 其他
# build: 构建
# pref: 优化
# test: 测试
###############################
on: on:
push: push:
# Sequence of patterns matched against refs/tags
tags: tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - 'v*' # 仅匹配 v* 版本标签,如 v1.0、v20.15.10
name: Create Release name: Create Release
permissions: write-all permissions:
contents: write
jobs: jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: bcmath, curl, gd, mbstring, openssl
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Run tests
run: composer test
- name: Run static analysis
run: composer analyse
release: release:
needs:
- verify
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
@ -16,50 +53,39 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Node.js - name: Resolve Tags
uses: actions/setup-node@v4 id: tags
with:
node-version: 18
- name: Install dependencies
run: npm install -g gen-git-log
- name: Find Last Tag
id: last_tag
run: | run: |
CURRENT_TAG="${GITHUB_REF_NAME}"
# 获取所有标签,按版本排序(降序) PREVIOUS_TAG=$(git tag --list 'v*' --sort=-version:refname | grep -Fxv "$CURRENT_TAG" | head -n 1 || true)
Tags=$(git tag --list --sort=-version:refname)
echo "CURRENT_TAG=$CURRENT_TAG" >> "$GITHUB_ENV"
# 获取最新的标签(即列表中的第一个) echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> "$GITHUB_ENV"
LATEST_TAG=$(echo "$Tags" | awk 'NR==1 {print $1; exit}')
# 获取倒数第二个标签(如果存在)
if [[ -n "$Tags" ]]; then
# 使用 tail 获取除了最后一个标签之外的所有标签,然后用 head 获取第一个
SECOND_LATEST_TAG=$(echo "$Tags" | tail -n +2 | head -n 1)
else
SECOND_LATEST_TAG=""
fi
# 设置输出变量
echo "::set-output name=tag_last::${LATEST_TAG:-v1.0.0}"
echo "::set-output name=tag_second::${SECOND_LATEST_TAG:-v1.0.0}"
- name: Generate Release Notes - name: Generate Release Notes
run: | run: |
rm -rf log rm -rf log
newTag=${{ steps.last_tag.outputs.tag_last }} mkdir -p log
git-log -m tag -f -S ${{ steps.last_tag.outputs.tag_second }} -v ${newTag#v} {
echo "## Release ${CURRENT_TAG}"
echo
if [ -n "${PREVIOUS_TAG}" ]; then
echo "Compare: ${PREVIOUS_TAG}..${CURRENT_TAG}"
echo
git log --pretty=format:'- %s (%h)' "${PREVIOUS_TAG}..${CURRENT_TAG}"
else
echo "Initial tagged release."
echo
git log --pretty=format:'- %s (%h)' "${CURRENT_TAG}"
fi
echo
} > "log/${CURRENT_TAG}.md"
- name: Create Release - name: Create Release
id: create_release uses: softprops/action-gh-release@v2
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ${{ steps.last_tag.outputs.tag_last }} tag_name: ${{ env.CURRENT_TAG }}
release_name: Release ${{ steps.last_tag.outputs.tag_last }} name: Release ${{ env.CURRENT_TAG }}
body_path: log/${{steps.last_tag.outputs.tag_last}}.md body_path: log/${{ env.CURRENT_TAG }}.md
draft: false draft: false
prerelease: false prerelease: false

30
.github/workflows/split.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Split Repositorys
on: [ workflow_dispatch ]
jobs:
split:
if: github.repository == 'zoujingli/ThinkAdminDeveloper'
runs-on: ubuntu-latest
env:
SSH_PRIVATE_KEY: ${{ secrets.SPLIT_PRIVATE_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Private Key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "StrictHostKeyChecking no" >> ~/.ssh/config
- name: Split And Push
run: |
git config pull.rebase true
git config --global user.name "Anyon"
git config --global user.email "zoujingli@qq.com"
./.github/split-linux.sh

93
.gitignore vendored
View File

@ -1,34 +1,59 @@
.env .env
.git .git
.svn .svn
.idea .idea
.fleet .fleet
.vscode .vscode
.DS_Store .DS_Store
.phpunit.result.cache
/vendor .phpunit.cache/
/runtime
/safefile /log
/nbproject /vendor
/composer.lock /runtime
!composer.json /safefile
/build
/404.html /admin.phar
/.user.ini /nbproject
/index.html /composer.lock
/public/upload !composer.json
/public/404.html
/public/.user.ini ### 屏蔽环境文件
/public/index.html /404.html
/public/favicon.ico /.user.ini
/database/sqlite.db /index.html
/public/upload
/public/static/theme/css/_*.css* /public/404.html
/public/static/theme/css/node_modules /public/.htaccess
/public/static/theme/css/package-lock.json /public/.user.ini
/public/index.html
### 屏蔽数据库脚本 /public/favicon.ico
/database/migrations/*_install_*.php /database/*.db
/database/migrations/*_upgrade_*.php /database/*.sqlite
!database/migrations/*_install*_table.php /database/*.sqlite3
!database/migrations/*_install_package.php /database/*-journal
/database/*-shm
/database/*-wal
### 屏蔽插件文件
/app/admin
/app/wechat
### 屏蔽配置文件
/config/app.php
/config/cookie.php
/config/lang.php
/config/log.php
/config/route.php
/config/session.php
/config/view.php
/public/static/plugs
/public/static/theme
/public/static/login.js
/public/static/system.js
### 屏蔽数据库发布产物
/database/migrations/*
!/database/migrations/.gitkeep
!/database/migrations/.published.json

120
.php-cs-fixer.php Normal file
View File

@ -0,0 +1,120 @@
<?php
declare(strict_types=1);
/**
* +----------------------------------------------------------------------
* | ThinkAdmin Plugin for ThinkAdminDeveloper
* +----------------------------------------------------------------------
* | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
* +----------------------------------------------------------------------
* | Official Website: https://thinkadmin.top
* +----------------------------------------------------------------------
* | Licensed: https://mit-license.org
* | Disclaimer: https://thinkadmin.top/disclaimer
* | Vip Rights: https://thinkadmin.top/vip-introduce
* +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfig;
$header = <<<'EOF'
+----------------------------------------------------------------------
| ThinkAdmin Plugin for ThinkAdminDeveloper
+----------------------------------------------------------------------
| Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
+----------------------------------------------------------------------
| Official Website: https://thinkadmin.top
+----------------------------------------------------------------------
| Licensed: https://mit-license.org
| Disclaimer: https://thinkadmin.top/disclaimer
| Vip Rights: https://thinkadmin.top/vip-introduce
+----------------------------------------------------------------------
| Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
| Github Repository: https://github.com/zoujingli/ThinkAdmin
+----------------------------------------------------------------------
EOF;
$config = new Config();
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
return $config->setFinder($finder)->setUsingCache(false)->setRules([
'@PSR2' => true,
'@Symfony' => true,
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'separate' => 'none',
'location' => 'after_declare_strict',
],
'array_syntax' => [
'syntax' => 'short',
],
'list_syntax' => [
'syntax' => 'short',
],
'blank_line_before_statement' => [
'statements' => [
'declare',
],
],
'general_phpdoc_annotation_remove' => [
'annotations' => [
'author',
],
],
'ordered_imports' => [
'imports_order' => [
'class', 'function', 'const',
],
'sort_algorithm' => 'alpha',
],
'single_line_comment_style' => [
'comment_types' => [
],
],
'yoda_style' => [
'always_move_variable' => false,
'equal' => false,
'identical' => false,
],
'phpdoc_align' => [
'align' => 'left',
],
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'constant_case' => [
'case' => 'lower',
],
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
'line_ending' => true, // 所有的PHP文件编码必须一致
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
'no_empty_statement' => true, // 不应该存在空的结构体
'standardize_not_equals' => true, // 使用 <> 代替 !=
'blank_line_after_namespace' => true, // 命名空间之后空一行
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
'no_empty_comment' => true, // 不应该存在空注释
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
'cast_spaces' => ['space' => 'none'],
'class_attributes_separation' => true,
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'lowercase_static_reference' => true,
'linebreak_after_opening_tag' => true,
'multiline_comment_opening_closing' => true,
'no_useless_else' => true,
'no_unused_imports' => true,
'not_operator_with_successor_space' => false,
'not_operator_with_space' => false,
'ordered_class_elements' => true,
'php_unit_strict' => false,
'phpdoc_separation' => false,
]);

18
app/common.php Normal file
View File

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
if (!function_exists('admuri')) {
/**
* 兼容旧版后台页面 URL 生成函数。
*
* @param string $url 路由地址
* @param array $vars 路由参数
* @param bool|string $suffix 后缀配置
* @param bool|string $domain 域名配置
*/
function admuri(string $url = '', array $vars = [], bool|string $suffix = true, bool|string $domain = false): string
{
return sysuri($url, $vars, $suffix, $domain);
}
}

View File

@ -1,9 +1,25 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
/**
* +----------------------------------------------------------------------
* | ThinkAdmin Plugin for ThinkAdminDeveloper
* +----------------------------------------------------------------------
* | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
* +----------------------------------------------------------------------
* | Official Website: https://thinkadmin.top
* +----------------------------------------------------------------------
* | Licensed: https://mit-license.org
* | Disclaimer: https://thinkadmin.top/disclaimer
* | Vip Rights: https://thinkadmin.top/vip-introduce
* +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
// | Static Plugin for ThinkAdmin // | Static Plugin for ThinkAdmin
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] // | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top // | 官方网站: https://thinkadmin.top
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -22,6 +38,6 @@ class Index extends Controller
{ {
public function index() public function index()
{ {
$this->redirect(sysuri('admin/login/index')); $this->redirect(sysuri('system/login/index'));
} }
} }

View File

@ -6,7 +6,8 @@
"description": "Application Development Framework", "description": "Application Development Framework",
"keywords": [ "keywords": [
"ThinkAdmin", "ThinkAdmin",
"ThinkLibrary" "ThinkLibrary",
"WeChatDeveloper"
], ],
"authors": [ "authors": [
{ {
@ -14,26 +15,122 @@
"email": "zoujingli@qq.com" "email": "zoujingli@qq.com"
} }
], ],
"require": {
"php": ">=7.1",
"ext-json": "*",
"topthink/think-orm": "^2.0|^3.0",
"zoujingli/think-library": "^6.1",
"zoujingli/think-plugs-admin": "^1.0",
"zoujingli/think-plugs-wechat": "^1.0"
},
"autoload": { "autoload": {
"psr-0": {
"": "extend"
},
"psr-4": { "psr-4": {
"app\\": "app" "app\\": "app/"
} }
}, },
"config": { "require": {
"sort-packages": true, "php": "^8.1",
"allow-plugins": { "ext-gd": "*",
"zoujingli/think-install": true "ext-json": "*",
"ext-openssl": "*",
"topthink/framework": "^8.1",
"topthink/think-orm": "^4.0",
"workerman/workerman": "^5.1.9",
"zoujingli/think-plugs-account": "^8.0",
"zoujingli/think-plugs-builder": "^8.0",
"zoujingli/think-plugs-install": "^8.0",
"zoujingli/think-plugs-payment": "^8.0",
"zoujingli/think-plugs-system": "^8.0",
"zoujingli/think-plugs-wechat-client": "^8.0",
"zoujingli/think-plugs-wechat-service": "^8.0",
"zoujingli/think-plugs-wemall": "^8.0",
"zoujingli/think-plugs-worker": "^8.0",
"zoujingli/think-plugs-wuma": "^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^9.5|^10.0",
"phpstan/phpstan": "^2.0"
},
"scripts": {
"sync": [
"php-cs-fixer fix",
"@composer analyse"
],
"rewrite-model": [
"@php think xadmin:helper:model --reset",
"php-cs-fixer fix"
],
"database:publish": [
"@php think xadmin:publish"
],
"database:migrate": [
"@php think xadmin:publish --migrate"
],
"build:phar": [
"@database:publish",
"@php -d phar.readonly=0 think xadmin:builder --name=admin.phar"
],
"test:smoke": [
"php tests/smoke/plugin_refactor_smoke.php"
],
"test:unit": [
"vendor/bin/phpunit -c phpunit.xml.dist"
],
"test": [
"@test:smoke",
"@test:unit"
],
"analyse": "phpstan analyse --memory-limit 2G -c phpstan.neon ./app ./config ./plugin"
},
"repositories": [
{
"type": "path",
"url": "plugin/think-plugs-wuma"
},
{
"type": "path",
"url": "plugin/think-plugs-install"
},
{
"type": "path",
"url": "plugin/think-plugs-builder"
},
{
"type": "path",
"url": "plugin/think-plugs-worker"
},
{
"type": "path",
"url": "plugin/think-plugs-wechat-client"
},
{
"type": "path",
"url": "plugin/think-plugs-wechat-service"
},
{
"type": "path",
"url": "plugin/think-plugs-system"
},
{
"type": "path",
"url": "plugin/think-plugs-account"
},
{
"type": "path",
"url": "plugin/think-plugs-payment"
},
{
"type": "path",
"url": "plugin/think-plugs-wemall"
},
{
"type": "path",
"url": "plugin/think-plugs-static"
},
{
"type": "path",
"url": "plugin/think-library"
} }
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"zoujingli/think-plugs-install": true
},
"sort-packages": true
} }
} }

View File

@ -1,55 +1,94 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// 应用命名空间 // 应用命名空间
'app_namespace' => '', 'app_namespace' => '',
// 应用快速访问 // 默认本地应用兼容回退(建议优先使用 route.default_app
'app_express' => true, 'single_app' => 'index',
// 插件机制配置
'plugin' => [
// 插件编码 => 前缀 或 前缀数组,配置后覆盖插件默认前缀
'bindings' => [],
// 插件 API 统一入口前缀,例如 /api/{plugin}/...
'api_prefix' => 'api',
// 动态插件切换默认关闭,仅在显式开启时作为调试或兼容入口
'switch' => [
'enabled' => false,
'query' => '_plugin',
'header' => 'X-Plugin-App',
],
],
// 是否启用路由 // 是否启用路由
'with_route' => true, 'with_route' => true,
// 超级用户账号 // 超级用户账号
'super_user' => 'admin', 'super_user' => 'admin',
// 默认时区 // 默认时区
'default_timezone' => 'Asia/Shanghai', 'default_timezone' => 'Asia/Shanghai',
// 应用映射(多应用模式有效) // 表现层模式view 仅渲染页面api 仅返回 JSONmixed 根据控制器命名空间、Token 请求头与 Accept 自动切换
'app_map' => [], 'presentation' => [
// 域名绑定(多应用模式有效) 'mode' => 'mixed',
'domain_bind' => [], 'api_header' => 'Authorization',
// 禁止访问(多应用模式有效) ],
'deny_app_list' => [], // 后台 JWT 有效期0 表示不过期)
'system_token_expire' => 604800,
// 后台 JWT 认证 Cookie 名称Authorization 优先,其次读取此 Cookie
'system_token_cookie' => 'system_access_token',
// 上传令牌有效期(秒)
'system_upload_token_expire' => 1800,
// Token 会话默认有效期0 表示不过期)
'token_session_expire' => 7200,
// Token 会话读取时是否自动续期
'token_session_touch' => true,
// Token 会话惰性清理间隔(秒)
'token_session_gc_interval' => 300,
// Token 会话指定缓存仓库,留空使用默认仓库
'token_session_store' => '',
// 认证 Cookie 中的 Token 是否加密存储Header 中仍使用原始 Bearer Token
'token_cookie_encrypt' => true,
// 认证 Cookie Token 加密密钥,留空默认复用 jwtkey
'token_cookie_secret' => '',
// 终端账号 JWT 认证 Cookie 名称Authorization 优先,其次读取此 Cookie
'account_token_cookie' => 'account_access_token',
// 存储管理器实现类(由 System 插件提供默认实现)
'storage_manager_class' => \plugin\system\storage\StorageManager::class,
// CORS 启用状态(默认开启跨域) // CORS 启用状态(默认开启跨域)
'cors_on' => true, 'cors_on' => true,
// CORS 配置跨域域名(仅需填域名,留空则自动域名) // CORS 配置跨域域名(仅需填域名,留空则自动域名)
'cors_host' => [], 'cors_host' => [],
// CORS 授权请求方法 // CORS 授权请求方法
'cors_methods' => 'GET,PUT,POST,PATCH,DELETE', 'cors_methods' => 'GET,PUT,POST,PATCH,DELETE',
// CORS 是否允许携带 Cookie 等凭证
'cors_credentials' => false,
// CORS 跨域头部字段 // CORS 跨域头部字段
'cors_headers' => 'Api-Type,Api-Name,Api-Uuid,Jwt-Token,Api-Token,User-Form-Token,User-Token,Token', 'cors_headers' => 'X-Device-Code,X-Device-Type',
// X-Frame-Options 配置 // X-Frame-Options 配置
'cors_frame' => 'sameorigin', 'cors_frame' => 'sameorigin',
// RBAC 登录页面(填写登录地址) // RBAC 登录页面(填写登录地址)
'rbac_login' => '', 'rbac_login' => '',
// RBAC 忽略应用(填写应用名称) // RBAC 忽略应用(填写应用名称)
'rbac_ignore' => ['index'], 'rbac_ignore' => ['index'],
// 显示错误消息内容,仅生产模式有效 // 显示错误消息内容,仅生产模式有效
'error_message' => '页面错误!请稍后再试~', 'error_message' => '页面错误!请稍后再试~',
// 异常状态模板配置,仅生产模式有效 // 异常状态模板配置,仅生产模式有效
'http_exception_template' => [ 'http_exception_template' => [
404 => syspath('public/static/theme/err/404.html'), 404 => syspath('public/static/theme/err/404.html'),
500 => syspath('public/static/theme/err/500.html'), 500 => syspath('public/static/theme/err/500.html'),
], ],
]; ];

View File

@ -1,59 +1,62 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// 默认缓存驱动 // 默认缓存驱动
'default' => env('CACHE_TYPE', 'file'), 'default' => env('CACHE_TYPE', 'file'),
// 缓存连接配置 // 缓存连接配置
'stores' => [ 'stores' => [
'file' => [ 'file' => [
// 驱动方式 // 驱动方式
'type' => 'File', 'type' => 'File',
// 缓存保存目录 // 缓存保存目录
'path' => '', 'path' => '',
// 缓存名称前缀 // 缓存名称前缀
'prefix' => '', 'prefix' => '',
// 缓存有效期 0 表示永久缓存 // 缓存有效期 0 表示永久缓存
'expire' => 0, 'expire' => 0,
// 缓存标签前缀 // 缓存标签前缀
'tag_prefix' => 'tag:', 'tag_prefix' => 'tag:',
// 序列化机制 // 序列化机制
'serialize' => [], 'serialize' => [],
], ],
'safe' => [ 'safe' => [
// 驱动方式 // 驱动方式
'type' => 'File', 'type' => 'File',
// 缓存保存目录 // 缓存保存目录
'path' => syspath('safefile/cache/'), 'path' => runpath('safefile/cache/'),
// 缓存名称前缀 // 缓存名称前缀
'prefix' => '', 'prefix' => '',
// 缓存有效期 0 表示永久缓存 // 缓存有效期 0 表示永久缓存
'expire' => 0, 'expire' => 0,
// 缓存标签前缀 // 缓存标签前缀
'tag_prefix' => 'tag:', 'tag_prefix' => 'tag:',
// 序列化机制 // 序列化机制
'serialize' => [], 'serialize' => [],
], ],
'redis' => [ 'redis' => [
// 驱动方式 // 驱动方式
'type' => 'redis', 'type' => 'redis',
'host' => env('CACHE_REDIS_HOST', '127.0.0.1'), 'host' => env('CACHE_REDIS_HOST', '127.0.0.1'),
'port' => env('CACHE_REDIS_PORT', 6379), 'port' => env('CACHE_REDIS_PORT', 6379),
'select' => env('CACHE_REDIS_SELECT', 0), 'select' => env('CACHE_REDIS_SELECT', 0),
'password' => env('CACHE_REDIS_PASSWORD', ''), 'password' => env('CACHE_REDIS_PASSWORD', ''),
] ],
], ],
]; ];

View File

@ -1,32 +1,35 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// cookie 保存时间 // cookie 保存时间
'expire' => 0, 'expire' => 0,
// cookie 保存路径 // cookie 保存路径
'path' => '/', 'path' => '/',
// cookie 有效域名 // cookie 有效域名
'domain' => '', 'domain' => '',
// httponly 访问设置 // httponly 访问设置
'httponly' => true, 'httponly' => true,
// 是否使用 setcookie // 是否允许服务端写回 Cookie默认关闭开启后可回写认证与语言 Cookie
'setcookie' => true, 'setcookie' => false,
// cookie 安全传输,只支持 https 协议 // cookie 安全传输,只支持 https 协议
'secure' => request()->isSsl(), 'secure' => request()->isSsl(),
// samesite 安全设置,支持 'strict' 'lax' 'none' // samesite 安全设置,支持 'strict' 'lax' 'none'
'samesite' => request()->isSsl() ? 'none' : 'lax', 'samesite' => request()->isSsl() ? 'none' : 'lax',
]; ];

View File

@ -1,83 +1,86 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// 默认使用的数据库连接配置 // 默认使用的数据库连接配置
'default' => env('DB_TYPE', 'sqlite'), 'default' => env('DB_TYPE', 'sqlite'),
// 自定义时间查询规则 // 自定义时间查询规则
'time_query_rule' => [], 'time_query_rule' => [],
// 自动写入时间戳字段 // 自动写入时间戳字段
'auto_timestamp' => true, 'auto_timestamp' => true,
// 时间字段取出后的默认时间格式 // 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s', 'datetime_format' => 'Y-m-d H:i:s',
// 数据库连接配置信息 // 数据库连接配置信息
'connections' => [ 'connections' => [
'mysql' => [ 'mysql' => [
// 数据库类型 // 数据库类型
'type' => 'mysql', 'type' => 'mysql',
// 服务器地址 // 服务器地址
'hostname' => env('DB_MYSQL_HOST', '127.0.0.1'), 'hostname' => env('DB_MYSQL_HOST', '127.0.0.1'),
// 服务器端口 // 服务器端口
'hostport' => env('DB_MYSQL_PORT', '3306'), 'hostport' => env('DB_MYSQL_PORT', '3306'),
// 数据库名 // 数据库名
'database' => env('DB_MYSQL_DATABASE', 'thinkadmin'), 'database' => env('DB_MYSQL_DATABASE', 'thinkadmin'),
// 用户名 // 用户名
'username' => env('DB_MYSQL_USERNAME', 'root'), 'username' => env('DB_MYSQL_USERNAME', 'root'),
// 密码 // 密码
'password' => env('DB_MYSQL_PASSWORD', ''), 'password' => env('DB_MYSQL_PASSWORD', ''),
// 数据库连接参数 // 数据库连接参数
'params' => [], 'params' => [],
// 数据库表前缀 // 数据库表前缀
'prefix' => env('DB_MYSQL_PREFIX', ''), 'prefix' => env('DB_MYSQL_PREFIX', ''),
// 数据库编码默认采用 utf8mb4 // 数据库编码默认采用 utf8mb4
'charset' => env('DB_MYSQL_CHARSET', 'utf8mb4'), 'charset' => env('DB_MYSQL_CHARSET', 'utf8mb4'),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0, 'deploy' => 0,
// 数据库读写是否分离 主从式有效 // 数据库读写是否分离 主从式有效
'rw_separate' => false, 'rw_separate' => false,
// 读写分离后 主服务器数量 // 读写分离后 主服务器数量
'master_num' => 1, 'master_num' => 1,
// 指定从服务器序号 // 指定从服务器序号
'slave_no' => '', 'slave_no' => '',
// 检查字段是否存在 // 检查字段是否存在
'fields_strict' => true, 'fields_strict' => true,
// 是否需要断线重连 // 是否需要断线重连
'break_reconnect' => false, 'break_reconnect' => false,
// 监听SQL执行日志 // 监听SQL执行日志
'trigger_sql' => true, 'trigger_sql' => true,
// 开启字段类型缓存 // 开启字段类型缓存
'fields_cache' => isOnline(), 'fields_cache' => isOnline(),
], ],
'sqlite' => [ 'sqlite' => [
// 数据库类型 // 数据库类型
'type' => 'sqlite', 'type' => 'sqlite',
// 数据库文件 // 数据库文件
'database' => syspath('database/sqlite.db'), 'database' => runpath('database/sqlite.db'),
// 数据库编码默认采用 utf8 // 数据库编码默认采用 utf8
'charset' => 'utf8', 'charset' => 'utf8',
// 监听执行日志 // 监听执行日志
'trigger_sql' => true, 'trigger_sql' => true,
// 其他参数字段 // 其他参数字段
'deploy' => 0, 'deploy' => 0,
'suffix' => '', 'suffix' => '',
'prefix' => '', 'prefix' => '',
'hostname' => '', 'hostname' => '',
'hostport' => '', 'hostport' => '',
'username' => '', 'username' => '',
'password' => '', 'password' => '',
], ],
], ],
]; ];

View File

@ -1,39 +1,42 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// 默认语言 // 默认语言
'default_lang' => 'zh-cn', 'default_lang' => 'zh-cn',
// 允许的语言列表 // 允许的语言列表
'allow_lang_list' => ['zh-cn'], 'allow_lang_list' => ['zh-cn'],
// 转义为对应语言包名称 // 转义为对应语言包名称
'accept_language' => [ 'accept_language' => [
'en' => 'en-us', 'en' => 'en-us',
'zh-hans-cn' => 'zh-cn', 'zh-hans-cn' => 'zh-cn',
], ],
// 多语言自动侦测变量名 // 多语言自动侦测变量名
'detect_var' => 'lang', 'detect_var' => 'lang',
// 多语言 Cookie 变量 // 多语言 Cookie 变量(禁用 Cookie 持久化)
'cookie_var' => 'lang', 'cookie_var' => '__lang_disabled__',
// 多语言 Header 变量 // 多语言 Header 变量
'header_var' => 'lang', 'header_var' => 'lang',
// 使用 Cookie 记录 // 使用 Cookie 记录
'use_cookie' => true, 'use_cookie' => false,
// 是否支持语言分组 // 是否支持语言分组
'allow_group' => false, 'allow_group' => false,
// 扩展语言包 // 扩展语言包
'extend_list' => [], 'extend_list' => [],
]; ];

View File

@ -1,57 +1,60 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// 默认日志通道 // 默认日志通道
'default' => 'file', 'default' => 'file',
// 日志记录级别 // 日志记录级别
'level' => [], 'level' => [],
// 日志类型记录的通道 // 日志类型记录的通道
'type_channel' => [], 'type_channel' => [],
// 关闭全局日志写入 // 关闭全局日志写入
'close' => false, 'close' => false,
// 全局日志处理 支持闭包 // 全局日志处理 支持闭包
'processor' => null, 'processor' => null,
// 日志通道列表 // 日志通道列表
'channels' => [ 'channels' => [
'file' => [ 'file' => [
// 日志记录方式 // 日志记录方式
'type' => 'File', 'type' => 'File',
// 日志保存目录 // 日志保存目录
'path' => '', 'path' => '',
// 单文件日志写入 // 单文件日志写入
'single' => true, 'single' => true,
// 独立日志级别 // 独立日志级别
'apart_level' => true, 'apart_level' => true,
// 每个文件大小 ( 10兆 ) // 每个文件大小 ( 10兆 )
'file_size' => 10485760, 'file_size' => 10485760,
// 日志日期格式 // 日志日期格式
'time_format' => 'Y-m-d H:i:s', 'time_format' => 'Y-m-d H:i:s',
// 最大日志文件数量 // 最大日志文件数量
'max_files' => 100, 'max_files' => 100,
// 使用JSON格式记录 // 使用JSON格式记录
'json' => false, 'json' => false,
// 日志处理 // 日志处理
'processor' => null, 'processor' => null,
// 关闭通道日志写入 // 关闭通道日志写入
'close' => false, 'close' => false,
// 日志输出格式化 // 日志输出格式化
'format' => '[%s][%s] %s', 'format' => '[%s][%s] %s',
// 是否实时写入 // 是否实时写入
'realtime_write' => false, 'realtime_write' => false,
], ],
], ],
]; ];

View File

@ -1,19 +1,22 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// 忽略数据表,填写表名 // 忽略数据表,填写表名
'ignore' => [], 'ignore' => [],
@ -21,4 +24,4 @@ return [
'tables' => [], 'tables' => [],
// 备份数据表,填写表名 // 备份数据表,填写表名
'backup' => [], 'backup' => [],
]; ];

View File

@ -1,58 +1,61 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// pathinfo分隔符 // pathinfo分隔符
'pathinfo_depr' => '/', 'pathinfo_depr' => '/',
// URL伪静态后缀 // URL伪静态后缀
'url_html_suffix' => 'html', 'url_html_suffix' => 'html',
// URL普通方式参数 用于自动生成 // URL普通方式参数 用于自动生成
'url_common_param' => true, 'url_common_param' => true,
// 是否开启路由延迟解析 // 是否开启路由延迟解析
'url_lazy_route' => false, 'url_lazy_route' => false,
// 是否强制使用路由 // 是否强制使用路由
'url_route_must' => false, 'url_route_must' => false,
// 合并路由规则 // 合并路由规则
'route_rule_merge' => true, 'route_rule_merge' => true,
// 路由是否完全匹配 // 路由是否完全匹配
'route_complete_match' => true, 'route_complete_match' => true,
// 访问控制器层名称 // 访问控制器层名称
'controller_layer' => 'controller', 'controller_layer' => 'controller',
// 空控制器名 // 空控制器名
'empty_controller' => 'Error', 'empty_controller' => 'Error',
// 是否使用控制器后缀 // 是否使用控制器后缀
'controller_suffix' => false, 'controller_suffix' => false,
// 默认的路由变量规则 // 默认的路由变量规则
'default_route_pattern' => '[\w\.]+', 'default_route_pattern' => '[\w\.]+',
// 是否开启请求缓存 true 自动缓存 支持设置请求缓存规则 // 是否开启请求缓存 true 自动缓存 支持设置请求缓存规则
'request_cache' => false, 'request_cache' => false,
// 请求缓存有效期 // 请求缓存有效期
'request_cache_expire' => null, 'request_cache_expire' => null,
// 全局请求缓存排除规则 // 全局请求缓存排除规则
'request_cache_except' => [], 'request_cache_except' => [],
// 默认应用 // 默认本地应用
'default_app' => 'index', 'default_app' => 'index',
// 默认控制器名 // 默认控制器名
'default_controller' => 'Index', 'default_controller' => 'Index',
// 默认操作名 // 默认操作名
'default_action' => 'index', 'default_action' => 'index',
// 操作方法后缀 // 操作方法后缀
'action_suffix' => '', 'action_suffix' => '',
// 默认JSONP格式返回的处理方法 // 默认JSONP格式返回的处理方法
'default_jsonp_handler' => 'jsonpReturn', 'default_jsonp_handler' => 'jsonpReturn',
// 默认JSONP处理方法 // 默认JSONP处理方法
'var_jsonp_handler' => 'callback', 'var_jsonp_handler' => 'callback',
]; ];

View File

@ -1,28 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | Static Plugin for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static
// | github 代码仓库https://github.com/zoujingli/think-plugs-static
// +----------------------------------------------------------------------
return [
// 字段名称
'name' => env('SESSION_NAME', 'ssid'),
// 驱动方式
'type' => env('SESSION_TYPE', 'file'),
// 存储连接
'store' => env('SESSION_STORE', ''),
// 过期时间
'expire' => env('SESSION_EXPIRE', 7200),
// 文件前缀
'prefix' => env('SESSION_PREFIX', ''),
];

View File

@ -1,42 +1,45 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * | ThinkAdmin Plugin for ThinkAdminDeveloper
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * | Official Website: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * | Licensed: https://mit-license.org
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * | Disclaimer: https://thinkadmin.top/disclaimer
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * | Vip Rights: https://thinkadmin.top/vip-introduce
// +---------------------------------------------------------------------- * +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [ return [
// 模板引擎类型使用 Think // 模板引擎类型使用 Think
'type' => 'Think', 'type' => 'Think',
// 默认模板渲染规则 1.解析为小写+下划线 2.全部转换小写 3.保持操作方法 // 默认模板渲染规则 1.解析为小写+下划线 2.全部转换小写 3.保持操作方法
'auto_rule' => 1, 'auto_rule' => 1,
// 模板目录名 // 模板目录名
'view_dir_name' => 'view', 'view_dir_name' => 'view',
// 模板文件后缀 // 模板文件后缀
'view_suffix' => 'html', 'view_suffix' => 'html',
// 模板文件名分隔符 // 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR, 'view_depr' => DIRECTORY_SEPARATOR,
// 模板缓存配置 // 模板缓存配置
'tpl_cache' => isOnline(), 'tpl_cache' => isOnline(),
// 模板引擎标签开始标记 // 模板引擎标签开始标记
'tpl_begin' => '{', 'tpl_begin' => '{',
// 模板引擎标签结束标记 // 模板引擎标签结束标记
'tpl_end' => '}', 'tpl_end' => '}',
// 标签库标签开始标记 // 标签库标签开始标记
'taglib_begin' => '{', 'taglib_begin' => '{',
// 标签库标签结束标记 // 标签库标签结束标记
'taglib_end' => '}', 'taglib_end' => '}',
// 去除HTML空格换行 // 去除HTML空格换行
'strip_space' => true, 'strip_space' => true,
// 标签默认过滤输出方法 // 标签默认过滤输出方法
'default_filter' => 'htmlentities=###,ENT_QUOTES', 'default_filter' => 'htmlentities=###,ENT_QUOTES',
]; ];

71
config/worker.php Normal file
View File

@ -0,0 +1,71 @@
<?php
declare(strict_types=1);
/**
* +----------------------------------------------------------------------
* | ThinkAdmin Plugin for ThinkAdminDeveloper
* +----------------------------------------------------------------------
* | Copyright (c) 2014~2026 ThinkAdmin [ thinkadmin.top ]
* +----------------------------------------------------------------------
* | Official Website: https://thinkadmin.top
* +----------------------------------------------------------------------
* | Licensed: https://mit-license.org
* | Disclaimer: https://thinkadmin.top/disclaimer
* | Vip Rights: https://thinkadmin.top/vip-introduce
* +----------------------------------------------------------------------
* | Gitee Repository: https://gitee.com/zoujingli/ThinkAdmin
* | Github Repository: https://github.com/zoujingli/ThinkAdmin
* +----------------------------------------------------------------------
*/
return [
'defaults' => [
'runtime' => [
// 'stdout_file' => syspath('safefile/worker/shared.stdout.log'),
// 'log_max_size' => 10 * 1024 * 1024,
// 'stop_timeout' => 2,
// 'event_loop' => \Workerman\Events\Event::class,
],
'monitor' => [
'files' => [
'enabled' => true,
'interval' => 3,
'paths' => ['app', 'config', 'route', 'plugin'],
'extensions' => ['php', 'env', 'ini', 'yaml', 'yml'],
],
'memory' => [
'enabled' => true,
'interval' => 60,
'limit' => '1G',
],
],
],
'services' => [
'http' => [
'enabled' => true,
'label' => 'ThinkAdmin HTTP',
'driver' => 'http',
'server' => [
'host' => '127.0.0.1',
'port' => 2346,
'context' => [],
],
'process' => [
'name' => 'ThinkAdminHttp',
'count' => 4,
],
],
'queue' => [
'enabled' => true,
'label' => 'ThinkAdmin Queue',
'driver' => 'queue',
'process' => [
'name' => 'ThinkAdminQueue',
'count' => 2,
],
'queue' => [
'scan_interval' => 1,
'batch_limit' => 20,
],
],
],
];

21
license
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2014~2025 Anyon <zoujingli@qq.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -3,7 +3,7 @@
declare(strict_types=1); declare(strict_types=1);
/** /**
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | Payment Plugin for ThinkAdmin * // | ThinkAdmin Web Entry
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ] * // | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
@ -11,7 +11,7 @@ declare(strict_types=1);
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | 开源协议 ( https://mit-license.org ) * // | 开源协议 ( https://mit-license.org )
* // | 免责声明 ( https://thinkadmin.top/disclaimer ) * // | 免责声明 ( https://thinkadmin.top/disclaimer )
* // | 会员免费 ( https://thinkadmin.top/vip-introduce ) * // | 会员特权 ( https://thinkadmin.top/vip-introduce )
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin * // | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin
* // | github 代码仓库https://github.com/zoujingli/ThinkAdmin * // | github 代码仓库https://github.com/zoujingli/ThinkAdmin

View File

@ -1,4 +1,4 @@
User-agent: * User-agent: *
Disallow: /data Disallow: /data
Disallow: /admin Disallow: /system
Disallow: /wechat Disallow: /wechat

View File

@ -1,22 +1,24 @@
<?php <?php
// +---------------------------------------------------------------------- declare(strict_types=1);
// | Static Plugin for ThinkAdmin /**
// +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ] * // | ThinkAdmin Public Router
// +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top * // | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org ) * // | 官方网站: https://thinkadmin.top
// | 免责声明 ( https://thinkadmin.top/disclaimer ) * // +----------------------------------------------------------------------
// +---------------------------------------------------------------------- * // | 开源协议 ( https://mit-license.org )
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static * // | 免责声明 ( https://thinkadmin.top/disclaimer )
// | github 代码仓库https://github.com/zoujingli/think-plugs-static * // | 会员特权 ( https://thinkadmin.top/vip-introduce )
// +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin
* // | github 代码仓库https://github.com/zoujingli/ThinkAdmin
* // +----------------------------------------------------------------------
*/
if (is_file($_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME'])) { if (is_file($_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME'])) {
return false; return false;
} else { }
$_SERVER['SCRIPT_FILENAME'] = __DIR__ . '/index.php'; $_SERVER['SCRIPT_FILENAME'] = __DIR__ . '/index.php';
require $_SERVER['SCRIPT_FILENAME']; require $_SERVER['SCRIPT_FILENAME'];
}

View File

@ -1,16 +0,0 @@
# Security Policy
## Supported Versions
| Version | Supported |
|---------|--------------------|
| 6.x.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :x: |
| 3.0.x | :x: |
| 2.0.x | :x: |
| 1.0.x | :x: |
## Reporting a Vulnerability
If you have any security problems, you can email zoujingli@qq.com

4
think
View File

@ -4,7 +4,7 @@
declare(strict_types=1); declare(strict_types=1);
/** /**
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | Payment Plugin for ThinkAdmin * // | ThinkAdmin Console Entry
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ] * // | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
@ -12,7 +12,7 @@ declare(strict_types=1);
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | 开源协议 ( https://mit-license.org ) * // | 开源协议 ( https://mit-license.org )
* // | 免责声明 ( https://thinkadmin.top/disclaimer ) * // | 免责声明 ( https://thinkadmin.top/disclaimer )
* // | 会员免费 ( https://thinkadmin.top/vip-introduce ) * // | 会员特权 ( https://thinkadmin.top/vip-introduce )
* // +---------------------------------------------------------------------- * // +----------------------------------------------------------------------
* // | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin * // | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin
* // | github 代码仓库https://github.com/zoujingli/ThinkAdmin * // | github 代码仓库https://github.com/zoujingli/ThinkAdmin