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