refactor(api):调整模板目录
This commit is contained in:
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>部门管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>部门修改</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>部门新增</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
{#pear 后台边框#}
|
||||
<body class="pear-container">
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
</body>
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'treetable', 'popup'], function () {
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>图片上传</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
@@ -60,7 +60,7 @@
|
||||
{{ ' {{layui.util.toDateString(d.create_time, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'element', 'form', 'upload'], function () {
|
||||
let table = layui.table
|
||||
+1
-1
@@ -77,7 +77,7 @@
|
||||
<div class="loader"></div>
|
||||
</div>
|
||||
<!-- 依 赖 脚 本 -->
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['admin', 'jquery', 'layer', 'popup'], function () {
|
||||
let admin = layui.admin
|
||||
@@ -37,7 +37,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'layer', 'button', 'popup'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>首页</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/console1.css') }}"/>
|
||||
|
||||
<!-- 主 题 更 换 -->
|
||||
@@ -291,7 +291,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!--</div>-->
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['layer', 'echarts', 'element', 'count'], function () {
|
||||
var $ = layui.jquery,
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>日志</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/console2.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
@@ -38,7 +38,7 @@
|
||||
<span style="color: red">失败</span>
|
||||
{{# } }}'|safe }}
|
||||
</script>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
|
||||
let table = layui.table
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>权限</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'common/header.html' %}</head>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -83,7 +83,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>权限编辑</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -95,7 +95,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>权限</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
@@ -83,7 +83,7 @@
|
||||
</script>
|
||||
|
||||
</body>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'treetable', 'popup'], function () {
|
||||
let table = layui.table
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>角色新增</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>角色编辑</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
@@ -70,7 +70,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>角色管理</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'common/header.html' %}</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
@@ -72,7 +72,7 @@
|
||||
<input type="checkbox" name="enable" value="{{ "{{d.id}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="role-enable" {{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>角色授权</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['dtree', 'form', 'jquery'], function () {
|
||||
let dtree = layui.dtree
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form">
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>头像上传</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['jquery', 'layer', 'cropper', 'popup'], function () {
|
||||
let $ = layui.jquery
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>修改密码</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'popup'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>用户编辑</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -68,7 +68,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/user.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
@@ -101,7 +101,7 @@
|
||||
{{ ' {{layui.util.toDateString(d.update_at, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'dtree', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>个人中心</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'common/header.html' %}
|
||||
<style>
|
||||
.layui-form-item {
|
||||
margin-top: 17px !important;
|
||||
@@ -170,7 +170,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['element', 'jquery', 'layer', 'form'], function () {
|
||||
let $ = layui.jquery
|
||||
@@ -14,7 +14,7 @@ dept_api = Api(dept_bp)
|
||||
@dept_bp.get('/')
|
||||
@authorize("admin:dept:main", log=True)
|
||||
def main():
|
||||
return render_template('admin/department/main.html')
|
||||
return render_template('department/main.html')
|
||||
|
||||
|
||||
@dept_bp.get('/data')
|
||||
@@ -32,7 +32,7 @@ def data():
|
||||
class AddDepartment(Resource):
|
||||
@authorize("admin:dept:add", log=True)
|
||||
def get(self):
|
||||
return make_response(render_template('admin/department/add.html'))
|
||||
return make_response(render_template('department/add.html'))
|
||||
|
||||
@authorize("admin:dept:add", log=True)
|
||||
def post(self):
|
||||
@@ -98,7 +98,7 @@ class DeptURD(Resource):
|
||||
@authorize("admin:dept:edit", log=True)
|
||||
def get(self, dept_id):
|
||||
dept = Dept.query.filter_by(id=dept_id).first()
|
||||
return make_response(render_template('admin/department/edit.html', dept=dept))
|
||||
return make_response(render_template('department/edit.html', dept=dept))
|
||||
|
||||
@authorize("admin:dept:edit", log=True)
|
||||
def put(self, dept_id):
|
||||
|
||||
@@ -17,7 +17,7 @@ file_bp = Blueprint('file', __name__, url_prefix='/file')
|
||||
@file_bp.get('/')
|
||||
@authorize("admin:file:main", log=True)
|
||||
def index():
|
||||
return render_template('admin/file/photo.html')
|
||||
return render_template('file/photo.html')
|
||||
|
||||
|
||||
# 图片数据
|
||||
|
||||
@@ -14,11 +14,11 @@ def index():
|
||||
@index_bp.get('/admin')
|
||||
@login_required
|
||||
def admin_index():
|
||||
return render_template('admin/index.html', user=current_user)
|
||||
return render_template('index/admin_index.html', user=current_user)
|
||||
|
||||
|
||||
# 控制台页面
|
||||
@index_bp.get('/admin/welcome')
|
||||
@login_required
|
||||
def welcome():
|
||||
return render_template('admin/console/welcome.html')
|
||||
return render_template('index/welcome.html')
|
||||
|
||||
@@ -13,7 +13,7 @@ logs_bp = Blueprint('logs', __name__, url_prefix='/logs')
|
||||
@logs_bp.get('/')
|
||||
@authorize("admin:log:main")
|
||||
def index():
|
||||
return render_template('admin/admin_log/main.html')
|
||||
return render_template('logs_temp/main.html')
|
||||
|
||||
|
||||
@logs_bp.get('/login_log')
|
||||
|
||||
@@ -23,7 +23,7 @@ class Login(Resource):
|
||||
if current_user.is_authenticated:
|
||||
return redirect(url_for('admin.index'))
|
||||
# TODO 分离视图操作 最终实现接口登录与视图登录两套逻辑
|
||||
return make_response(render_template('admin/login.html'))
|
||||
return make_response(render_template('index/login.html'))
|
||||
|
||||
def post(self):
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ rights_api = Api(rights_bp)
|
||||
@rights_bp.get('/')
|
||||
@authorize("admin:power:main", log=True)
|
||||
def index():
|
||||
return render_template('admin/rights/main.html')
|
||||
return render_template('rights/main.html')
|
||||
|
||||
|
||||
from . import routes
|
||||
|
||||
@@ -79,7 +79,7 @@ class AddRight(Resource):
|
||||
@authorize("admin:power:add", log=True)
|
||||
def get(self):
|
||||
"""获取增加视图"""
|
||||
return make_response(render_template('admin/rights/add.html'))
|
||||
return make_response(render_template('rights/add.html'))
|
||||
|
||||
@authorize("admin:power:add", log=True)
|
||||
def post(self):
|
||||
@@ -115,7 +115,7 @@ class RightsURD(Resource):
|
||||
icon = icon[1]
|
||||
else:
|
||||
icon = None
|
||||
return make_response(render_template('admin/rights/edit.html', power=power, icon=icon))
|
||||
return make_response(render_template('rights/edit.html', power=power, icon=icon))
|
||||
|
||||
@authorize("admin:power:remove", log=True)
|
||||
def delete(self, power_id):
|
||||
|
||||
@@ -11,14 +11,14 @@ role_bp = Blueprint('role', __name__, url_prefix='/admin/role')
|
||||
@role_bp.get('/')
|
||||
@authorize("admin:role:main", log=True)
|
||||
def main():
|
||||
return render_template('admin/role/main.html')
|
||||
return render_template('roles/main.html')
|
||||
|
||||
|
||||
# 角色授权操作
|
||||
@role_bp.get('/power/<int:_id>')
|
||||
@authorize("admin:role:power", log=True)
|
||||
def power(_id):
|
||||
return render_template('admin/role/power.html', id=_id)
|
||||
return render_template('roles/power.html', id=_id)
|
||||
|
||||
|
||||
from . import role
|
||||
@@ -55,7 +55,7 @@ def table():
|
||||
class AddRole(Resource):
|
||||
@authorize("admin:role:add", log=True)
|
||||
def get(self):
|
||||
return make_response(render_template('admin/role/add.html'))
|
||||
return make_response(render_template('roles/add.html'))
|
||||
|
||||
@authorize("admin:role:add", log=True)
|
||||
def post(self):
|
||||
@@ -147,7 +147,7 @@ class EditRole(Resource):
|
||||
@authorize("admin:role:edit", log=True)
|
||||
def get(self, role_id):
|
||||
role = Role.query.filter_by(id=role_id).first()
|
||||
return make_response(render_template('admin/role/edit.html', role=role))
|
||||
return make_response(render_template('roles/edit.html', role=role))
|
||||
|
||||
# 更新角色
|
||||
@authorize("admin:role:edit", log=True)
|
||||
|
||||
@@ -13,7 +13,7 @@ users_bp = Blueprint('users', __name__, url_prefix='/users')
|
||||
@users_bp.get('/')
|
||||
@authorize("admin:user:main", log=True)
|
||||
def get():
|
||||
return render_template('admin/user/main.html')
|
||||
return render_template('users/main.html')
|
||||
|
||||
|
||||
@users_bp.get('/center')
|
||||
@@ -21,7 +21,7 @@ def get():
|
||||
def center():
|
||||
user_logs = AdminLog.query.filter_by(url='/passport/login').filter_by(uid=current_user.id).order_by(
|
||||
desc(AdminLog.create_time)).limit(10)
|
||||
return render_template('admin/user/profile.html', user_info=current_user, user_logs=user_logs)
|
||||
return render_template('users/profile.html', user_info=current_user, user_logs=user_logs)
|
||||
|
||||
|
||||
user_api = Api(users_bp)
|
||||
|
||||
@@ -17,7 +17,7 @@ class Avatar(Resource):
|
||||
"""修改头像"""
|
||||
|
||||
def get(self):
|
||||
return make_response(render_template('admin/user/avatar.html'))
|
||||
return make_response(render_template('users/avatar.html'))
|
||||
|
||||
def put(self):
|
||||
url = request.json.get("avatar").get("src")
|
||||
@@ -53,7 +53,7 @@ class EditPassword(Resource):
|
||||
|
||||
@login_required
|
||||
def get(self):
|
||||
return make_response(render_template('admin/user/edit_password.html'))
|
||||
return make_response(render_template('users/edit_password.html'))
|
||||
|
||||
@login_required
|
||||
def put(self):
|
||||
|
||||
@@ -18,7 +18,7 @@ class Users(Resource):
|
||||
@authorize("admin:user:add", log=True)
|
||||
def get(self):
|
||||
roles = Role.query.all()
|
||||
return make_response(render_template('admin/user/add.html', roles=roles))
|
||||
return make_response(render_template('users/add.html', roles=roles))
|
||||
|
||||
@authorize("admin:user:add", log=True)
|
||||
def post(self):
|
||||
@@ -66,9 +66,9 @@ class CURDUser(Resource):
|
||||
for r in user.role:
|
||||
checked_roles.append(r.id)
|
||||
return make_response(
|
||||
render_template('admin/user/edit_users.html', user=user, roles=roles, checked_roles=checked_roles))
|
||||
render_template('users/edit_users.html', user=user, roles=roles, checked_roles=checked_roles))
|
||||
|
||||
@authorize("admin:user:remove", log=True)
|
||||
@authorize("admin:users:remove", log=True)
|
||||
def delete(self, user_id):
|
||||
# 删除用户
|
||||
res = _utils.delete_by_id(user_id)
|
||||
@@ -76,7 +76,7 @@ class CURDUser(Resource):
|
||||
return fail_api(msg="删除失败")
|
||||
return success_api(msg="删除成功")
|
||||
|
||||
@authorize("admin:user:edit", log=True)
|
||||
@authorize("admin:users:edit", log=True)
|
||||
def put(self, user_id):
|
||||
|
||||
parser = reqparse.RequestParser()
|
||||
|
||||
Reference in New Issue
Block a user