更新README,删除无用的文件,删除无用的代码

This commit is contained in:
mkg
2021-03-26 21:22:42 +08:00
parent 2455351347
commit 6757c5d595
3 changed files with 62 additions and 38 deletions
+62
View File
@@ -24,6 +24,7 @@
</a> </a>
</p> </p>
</div> </div>
<div align="center"> <div align="center">
<img width="92%" style="border-radius:10px;margin-top:20px;margin-bottom:20px;box-shadow: 2px 0 6px gray;" src="https://images.gitee.com/uploads/images/2020/1019/104805_042b888c_4835367.png" /> <img width="92%" style="border-radius:10px;margin-top:20px;margin-bottom:20px;box-shadow: 2px 0 6px gray;" src="https://images.gitee.com/uploads/images/2020/1019/104805_042b888c_4835367.png" />
</div> </div>
@@ -41,6 +42,67 @@ Pear Admin Flask 分为 Common / Simple 两个版本:
[** Simple 简洁版本 **](https://gitee.com/pear-admin/pear-admin-flask/tree/simple/) [** Simple 简洁版本 **](https://gitee.com/pear-admin/pear-admin-flask/tree/simple/)
#### 内置功能
- [x] 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
- [x] 权限管理:配置系统菜单,操作权限,按钮权限标识等。
- [x] 角色管理:角色菜单权限分配。
- [x] 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
- [x] 登录日志:系统登录日志记录查询包含登录异常。
- [x] 服务监控:监视当前系统CPU、内存、磁盘、python版本,运行时长等相关信息。
- [x] 文件上传: 图片上传示例
- [ ] 代码生成: 构想中....
#### 项目结构
```
Pear Admin Flask:Common版本
├─applications
│ ├─config
│ │ └─ common.py #普通配置
│ │ └─ database.py #数据库配置
│ ├─models
│ │ └─admin.py #基本模型
│ ├─service
│ │ ├─admin
│ │ │ └─ file.py #file视图的数据操作
│ │ │ └─ index.py #index视图的数据操作
│ │ │ └─ power.py #power视图的数据操作
│ │ │ └─ role.py #role视图的数据操作
│ │ │ └─ user.py #user视图的数据操作
│ │ └─ admin_log.py #存储日志
│ │ └─ deBug.py #deBug工具栏初始化
│ │ └─ login.py #flask_login初始化
│ │ └─ CaptchaTool.py #验证码
│ │ └─ OriginalDb.py #原生sql查询封装
│ │ └─ route_auth.py #权限
│ │ └─ upload.py #上传
│ ├─views
│ │ ├─admin #前台视图
│ │ │ └─index.py #主视图
│ │ │ └─user.py 用户视图
│ │ │ └─role.py #角色视图
│ │ │ └─power.py #权限视图
│ │ │ └─monitor.py #系统监控
│ │ │ └─file.py #文件上传
│ │ │ └─admin_log.py #系统日志
│ │ │ └─context_processor.py #全局模板函数注册
│ │ │ └─error.py #错误处理
│ │ │ └─__init__.py #蓝图注册
│ │ ├─index #前台视图
├─dev #数据库初始化
├─migrations
├─readmes
├─static #静态资源
│ └─upload #文件上传地址
├─templates
│ ├─admin #前台模板
│ ├─errors #错误模板
│ └─index #前台模板
```
#### 项目安装 #### 项目安装
```bash ```bash
-33
View File
@@ -1,33 +0,0 @@
import yaml
import glob
def read_yaml(yaml_file_path):
try:
with open(yaml_file_path, 'rb') as f:
cf = f.read()
except FileNotFoundError:
print('未找到配置文件')
c = yaml.safe_load(cf)
return c
def read_all_yaml(menu_yaml_path):
lista = []
lst = glob.glob(menu_yaml_path)
for l in lst:
a = read_yaml(l)
lista.append(a)
return lista
def make_tree(menu_yaml_path, role):
a = read_all_yaml(menu_yaml_path)
auth_tree = []
for i in a:
if role in i.get('auth'):
i_date = i.get('data')
auth_tree.append(i_date)
auth_tree.sort(key=lambda y:y['id'])
return auth_tree
-5
View File
@@ -32,11 +32,6 @@ def create_app():
OpenDug(app) OpenDug(app)
# logo # logo
logo() logo()
@app.template_global
def authorize(power):
return bool(power in session.get('permissions'))
return app return app