Skip to content

Commit

Permalink
feat: update to thinkphp6
Browse files Browse the repository at this point in the history
fix: update demo url
  • Loading branch information
leeqvip committed Feb 18, 2023
1 parent ad7d6cd commit 812176d
Show file tree
Hide file tree
Showing 98 changed files with 1,519 additions and 653 deletions.
60 changes: 28 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@
</h1>

<p align="center">
<strong>一个基于ThinkPHP5.1+和AmazeUI的快速后台开发框架</strong>
<strong>一个基于ThinkPHP的一款非侵入式后台开发框架!</strong>
</p>

<p align="center">
<a href="https://styleci.io/repos/161045623">
<img src="https://styleci.io/repos/161045623/shield?branch=master" alt="StyleCI">
</a>
<a href="https://packagist.org/packages/techone/tadmin">
<img src="https://poser.pugx.org/techone/tadmin/v/stable.png" alt="Latest Stable Version">
<p align="center">
<a href="https://packagist.org/packages/leeqvip/tadmin">
<img src="https://poser.pugx.org/leeqvip/tadmin/v/stable.png" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/techone/tadmin">
<img src="https://poser.pugx.org/techone/tadmin/downloads.png" alt="Total Downloads">
<a href="https://packagist.org/packages/leeqvip/tadmin">
<img src="https://poser.pugx.org/leeqvip/tadmin/downloads.png" alt="Total Downloads">
</a>
<a href="https://packagist.org/packages/techone/tadmin">
<img src="https://poser.pugx.org/techone/tadmin/license.png" alt="License">
<a href="https://packagist.org/packages/leeqvip/tadmin">
<img src="https://poser.pugx.org/leeqvip/tadmin/license.png" alt="License">
</a>
</p>

Expand All @@ -29,34 +26,33 @@

## 安装

最方便的安装方式就是使用Composer ( https://getcomposer.org/ ),在这之前**务必**先搭建好thinkphp5.1项目
最方便的安装方式就是使用Composer ( https://getcomposer.org/ ),在这之前**务必**先搭建好thinkphp项目

1、安装 Tadmin :
1、安装Tadmin

```
composer require techone/tadmin
composer require leeqvip/tadmin
```

2、初始化和数据迁移
2、注册服务

```
php think tadmin:init
php think tadmin:migrate:run
```

3、配置
注册服务,在应用的全局公共文件`service.php`中加入:

添加行为在 `application/tags.php`
```php
return [
// ...

tadmin\TadminService::class,
];
```
return [

'app_init' => [
\tadmin\behavior\Boot::class,
],
3、执行初始化和数据库迁移:

// ...
];
**确保数据库配置信息正确**

```
php think tadmin:init
php think tadmin:migrate:run
```

## 进入tadmin后台
Expand All @@ -68,12 +64,12 @@ http://yourdomain/tadmin
## 演示地址

**后台**
http://tadmin.v.tech1024.com/tadmin
http://tadmin.tech1024.com/tadmin

用户名:admin 密码:abc-123

**前台**
http://tadmin.v.tech1024.com
http://tadmin.tech1024.com

## 协议

Expand All @@ -82,5 +78,5 @@ http://tadmin.v.tech1024.com
## 联系

有问题或者功能建议,请联系我们或者提交PR:
- https://github.com/techoner/tadmin/issues
- techlee@qq.com
- https://github.com/leeqvip/tadmin/issues
- leeqvip@gmail.com
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "techone/tadmin",
"description": "the admin framework based on thinkphp",
"keywords": [
"name": "leeqvip/tadmin",
"description": "the admin framework based on thinkphp",
"keywords": [
"framework",
"thinkphp",
"admin"
Expand All @@ -14,19 +14,20 @@
}
],
"require": {
"php": ">=5.6.0",
"topthink/think-migration": "^2.0",
"topthink/think-captcha": "^2.0",
"php": ">=7.1.0",
"topthink/think-migration": "^3.0",
"topthink/think-captcha": "^3.0",
"league/flysystem": "^1.0",
"techone/support": "0.*",
"casbin/think-adapter": "~1.0"
"casbin/think-authz": "^1.0",
"topthink/think-view": "^1.0"
},
"autoload": {
"psr-4": {
"tadmin\\": "src/"
},
"files": [
"helper.php"
"helper.php"
]
},
"extra": {
Expand All @@ -35,4 +36,4 @@
"config": {
"preferred-install": "dist"
}
}
}
32 changes: 0 additions & 32 deletions config/casbin.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/command.php

This file was deleted.

11 changes: 11 additions & 0 deletions config/console.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
// +----------------------------------------------------------------------
// | 控制台配置
// +----------------------------------------------------------------------
return [
// 指令定义
'commands' => [
'tadmin:init' => \tadmin\command\Init::class,
'tadmin:migrate:run' => \tadmin\command\Migrate::class,
],
];
27 changes: 0 additions & 27 deletions config/filesystems.php

This file was deleted.

12 changes: 7 additions & 5 deletions config/middleware.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

return [
'tadmin.admin' => [
\tadmin\middleware\AuthCheck::class,
\tadmin\middleware\PermissionCheck::class,
\tadmin\middleware\LogRecord::class,
],
"alias" => [
'tadmin.admin' => [
\tadmin\middleware\AuthCheck::class,
\tadmin\middleware\PermissionCheck::class,
\tadmin\middleware\LogRecord::class,
],
]
];
7 changes: 0 additions & 7 deletions config/paginate.php

This file was deleted.

1 change: 1 addition & 0 deletions config/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
\tadmin\service\auth\contract\Authenticate::class => \tadmin\model\Adminer::class,
\tadmin\service\auth\guard\contract\Guard::class => \tadmin\service\auth\guard\SessionGuard::class,
\tadmin\service\auth\contract\Auth::class => \tadmin\service\auth\Auth::class,
\think\Paginator::class => \tadmin\paginator\driver\Amazeui::class,
];
39 changes: 39 additions & 0 deletions config/tadmin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Tadmin 配置.
*
Expand All @@ -15,4 +16,42 @@
'__TADMIN_ASSETS__' => '/tmp/assets',
],
],
/*
*Default Tauthz enforcer
*/
'enforcer' => [
'model_config_path' => __DIR__ . '/casbin-model.conf',
'adapter' => tadmin\service\casbin\Adapter::class,
],

// 模板配置
'view' => [
// 模板引擎类型使用Think
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
// 模板文件路径
'view_path' => admin_view_path(),
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',

// 公共目录
'public_name' => 'public',

'tpl_replace_string' => [
'__TADMIN_ASSETS__' => '/tmp/assets',
],
],
];
19 changes: 19 additions & 0 deletions config/tauthz.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return [
'enforcers' => [
'tadmin' => [
/*
* Model 设置
*/
'model' => [
// 可选值: "file", "text"
'config_type' => 'file',
'config_file_path' => __DIR__ . '/casbin-model.conf',
],

// 适配器 .
'adapter' => \tadmin\service\casbin\Adapter::class,
],
],
];
Loading

0 comments on commit 812176d

Please sign in to comment.