This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
266 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,45 @@ | ||
##tpadmin 是什么? | ||
> 当前版本: v1.2 | ||
## tpadmin 是什么? | ||
tpadmin 是一个基于 ThinkPHP5.0 正式版和 Hui.admin v2.5 的管理后台,简化管理后台的开发流程,简化代码的编写,提高代码复用率,同时集成完整的权限管理和其他管理后台中常用的功能 | ||
|
||
##官方文档 | ||
## 官方文档 | ||
[http://www.kancloud.cn/yuan1994/tpadmin](http://www.kancloud.cn/yuan1994/tpadmin) | ||
|
||
##在线体验 | ||
[http://tpadmin.demo.tianpian.net.cn](http://tpadmin.demo.tianpian.net.cn) | ||
## 在线体验 | ||
[http://tpadmin.yuan1994.com](http://tpadmin.yuan1994.com) | ||
|
||
默认管理员帐号:admin,默认管理员密码:123456 | ||
|
||
tpadmin 官方交流群:518162472 | ||
|
||
##仓库地址 | ||
## 仓库地址 | ||
[https://github.com/yuan1994/tpadmin](https://github.com/yuan1994/tpadmin) | ||
|
||
##使用方法 | ||
###git克隆: | ||
git clone [email protected]:yuan1994/tpadmin.git | ||
###直接下载: | ||
## 使用方法 | ||
|
||
### composer安装 | ||
composer create-project yuan1994/tpadmin tpadmin --prefer-dist | ||
|
||
### git克隆: | ||
git clone https://github.com/yuan1994/tpadmin | ||
### 直接下载: | ||
https://github.com/yuan1994/tpadmin/archive/master.zip | ||
> 框架的依赖需要通过 composer 下载,请在框架根目录执行 composer update ,已确保依赖的类库能下载下来 | ||
##特性 | ||
###后端 | ||
* 模板、控制器、模型、验证器、数据表自动生成 | ||
## 部署 | ||
参考 [ThinkPHP5 - 部署](http://www.kancloud.cn/manual/thinkphp5/129745) | ||
|
||
部署成功后,建立新建数据库 tpadmin,导入项目根目录的 tpadmin.sql 文件,默认管理员帐号:admin,默认管理员密码:123456,然后访问 http://your-tpadmin-root-domain/admin(都已开启伪静态模式) | ||
|
||
## 特性 | ||
### 后端 | ||
* 模板、控制器、模型、验证器代码、数据表自动生成 | ||
* 根据数据库字段生成相应 CURD 模型 | ||
* 支持终端生成代码、查看数据库信息,并且支持浏览器模拟终端功能 | ||
* RBAC 权限管理 | ||
* 完美支持多级控制器及多级控制器权限管理 | ||
* 支持前置方法 before | ||
* 支持前置方法 before 和 黑名单方法拦截器 | ||
* 支持模板主题 | ||
* 节点自动扫描与添加 | ||
* 七牛上传及与百度编辑器 (Ueditor) 结合使用 | ||
|
@@ -36,7 +49,7 @@ https://github.com/yuan1994/tpadmin/archive/master.zip | |
* 网站操作日志记录(自动水平分表) | ||
* 图片上传管理及回调 | ||
|
||
###前端 | ||
### 前端 | ||
* 表单校验 | ||
* 无限层级菜单,完美与后端多级控制器兼容 | ||
* 自动面包屑导航 | ||
|
@@ -50,7 +63,7 @@ https://github.com/yuan1994/tpadmin/archive/master.zip | |
* 二维码生成 | ||
|
||
|
||
##鸣谢: | ||
## 鸣谢: | ||
本平台使用了如下框架或插件、源码 | ||
* ThinkPHP 5.0正式版 | ||
* Hui.admin v2.5 | ||
|
@@ -61,5 +74,5 @@ https://github.com/yuan1994/tpadmin/archive/master.zip | |
|
||
>非常感谢这些框架、插件的支持 | ||
##License | ||
## License | ||
Apache 2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,29 @@ | |
/** | ||
* tpAdmin [a web admin based ThinkPHP5] | ||
* | ||
* @author yuan1994 <[email protected]> | ||
* @link http://tpadmin.yuan1994.com/ | ||
* @author yuan1994 <[email protected]> | ||
* @link http://tpadmin.yuan1994.com/ | ||
* @copyright 2016 yuan1994 all rights reserved. | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
use \think\Request; | ||
|
||
$basename = Request::instance()->root(); | ||
if (pathinfo($basename, PATHINFO_EXTENSION) == 'php') { | ||
$basename = dirname($basename); | ||
} | ||
|
||
return [ | ||
// 模板参数替换 | ||
'view_replace_str' => [ | ||
'__ROOT__' => Request::instance()->root(), | ||
'__STATIC__' => Request::instance()->root() . '/static/admin', | ||
'__LIB__' => Request::instance()->root() . '/static/admin/lib', | ||
'__ROOT__' => $basename, | ||
'__STATIC__' => $basename . '/static/admin', | ||
'__LIB__' => $basename . '/static/admin/lib', | ||
], | ||
|
||
// traits 目录 | ||
'traits_path' => APP_PATH . 'admin' . DS . 'traits' . DS, | ||
'traits_path' => APP_PATH . 'admin' . DS . 'traits' . DS, | ||
|
||
// 异常处理 handle 类 留空使用 \think\exception\Handle | ||
'exception_handle' => '\\TpException', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
/** | ||
* tpAdmin [a web admin based ThinkPHP5] | ||
* | ||
* @author yuan1994 <[email protected]> | ||
* @link http://tpadmin.yuan1994.com/ | ||
* @author yuan1994 <[email protected]> | ||
* @link http://tpadmin.yuan1994.com/ | ||
* @copyright 2016 yuan1994 all rights reserved. | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
//------------------------ | ||
|
@@ -14,19 +14,21 @@ | |
|
||
namespace app\admin\controller; | ||
|
||
\think\Loader::import('controller/Controller', \think\Config::get('traits_path') , EXT); | ||
\think\Loader::import('controller/Controller', \think\Config::get('traits_path'), EXT); | ||
|
||
use app\admin\Controller; | ||
|
||
class AdminGroup extends Controller | ||
{ | ||
use \app\admin\traits\controller\Controller; | ||
|
||
protected static $blacklist = ['recyclebin', 'delete', 'recycle', 'deleteforever', 'clear']; | ||
protected static $blacklist = ['deleteforever', 'clear']; | ||
|
||
protected function filter(&$map) | ||
{ | ||
if ($this->request->param('name')) $map['name'] = ["like", "%" . $this->request->param('name') . "%"]; | ||
if ($this->request->param('name')) { | ||
$map['name'] = ["like", "%" . $this->request->param('name') . "%"]; | ||
} | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.