diff --git a/applications/common/admin/dept_curd.py b/applications/common/admin/dept_curd.py
index 0e0a978..f402888 100644
--- a/applications/common/admin/dept_curd.py
+++ b/applications/common/admin/dept_curd.py
@@ -2,7 +2,6 @@ from applications.extensions import db
from applications.models import Dept, DeptSchema
from applications.models import User
from applications.common.curd import model_to_dicts
-from flask import escape
def get_dept_dict():
@@ -12,14 +11,14 @@ def get_dept_dict():
def save_dept(req):
- address = escape(req.get("address"))
- deptName = escape(req.get("deptName"))
- email = escape(req.get("email"))
- leader = escape(req.get("leader"))
- parentId = escape(req.get("parentId"))
- phone = escape(req.get("phone"))
- sort = escape(req.get("sort"))
- status = escape(req.get("status"))
+ address = req.get("address")
+ deptName = req.get("deptName")
+ email = req.get("email")
+ leader = req.get("leader")
+ parentId = req.get("parentId")
+ phone = req.get("phone")
+ sort = req.get("sort")
+ status = req.get("status")
dept = Dept(
parent_id=parentId,
dept_name=deptName,
@@ -65,13 +64,13 @@ def update_dept(json):
""" 更新部门信息 """
_id = json.get("deptId"),
data = {
- "dept_name": escape(json.get("deptName")),
- "sort": escape(json.get("sort")),
- "leader": escape(json.get("leader")),
- "phone": escape(json.get("phone")),
- "email": escape(json.get("email")),
- "status": escape(json.get("status")),
- "address": escape(json.get("address"))
+ "dept_name": json.get("deptName"),
+ "sort": json.get("sort"),
+ "leader": json.get("leader"),
+ "phone": json.get("phone"),
+ "email": json.get("email"),
+ "status": json.get("status"),
+ "address": json.get("address")
}
d = Dept.query.filter_by(id=_id).update(data)
if not d:
diff --git a/applications/common/utils/gen_captcha.py b/applications/common/utils/gen_captcha.py
index 622a6e1..e69de29 100644
--- a/applications/common/utils/gen_captcha.py
+++ b/applications/common/utils/gen_captcha.py
@@ -1,14 +0,0 @@
-from captcha.image import ImageCaptcha
-
-from PIL import Image
-from random import choices
-
-
-def gen_captcha(content='0123456789'):
- """ 生成验证码 """
- image = ImageCaptcha()
- # 获取字符串
- captcha_text = "".join(choices(content, k=4))
- # 生成图像
- captcha_image = Image.open(image.generate(captcha_text))
- return captcha_text, captcha_image
diff --git a/applications/extensions/init_databases/__init__.py b/applications/extensions/init_databases/__init__.py
index 8e4a07e..97ab387 100644
--- a/applications/extensions/init_databases/__init__.py
+++ b/applications/extensions/init_databases/__init__.py
@@ -302,7 +302,7 @@ course_data = [
phase_data = [
{'name': '基础课'},
- {'name': '进阶'},
+ {'name': '高级开发'},
{'name': '爬虫'},
{'name': '数据分析'},
{'name': '全栈课程'}
diff --git a/applications/templates/admin/admin_log/main.html b/applications/templates/admin/admin_log/main.html
index cf5a1a8..ea6eca9 100644
--- a/applications/templates/admin/admin_log/main.html
+++ b/applications/templates/admin/admin_log/main.html
@@ -12,14 +12,14 @@
@@ -44,7 +44,7 @@
let table = layui.table
let form = layui.form
- let MODULE_PATH = '/admin/log/'
+ let MODULE_PATH = '/logs/'
let cols = [
[
@@ -61,8 +61,8 @@
]
table.render({
- elem: '#log-operate-table',
- url: MODULE_PATH + 'operateLog',
+ elem: '#log-access-table',
+ url: MODULE_PATH + 'access_log',
page: true,
cols: cols,
skin: 'line',
@@ -71,7 +71,7 @@
table.render({
elem: '#log-login-table',
- url: MODULE_PATH + 'loginLog',
+ url: MODULE_PATH + 'login_log',
page: true,
cols: cols,
skin: 'line',
diff --git a/applications/templates/admin/dept/edit.html b/applications/templates/admin/dept/edit.html
index eabbe84..de35fb6 100644
--- a/applications/templates/admin/dept/edit.html
+++ b/applications/templates/admin/dept/edit.html
@@ -97,6 +97,7 @@
let form = layui.form
let $ = layui.jquery
+ // 当点击更新之后,获取数据
form.on('submit(dept-update)', function (data) {
$.ajax({
url: '/dept/update',
@@ -107,7 +108,7 @@
success: function (result) {
if (result.success) {
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
- parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
+ parent.layer.close(parent.layer.getFrameIndex(window.name)) //关闭当前页
parent.render()
})
} else {
diff --git a/applications/templates/admin/dept/main.html b/applications/templates/admin/dept/main.html
index 13d7503..bcfb56c 100644
--- a/applications/templates/admin/dept/main.html
+++ b/applications/templates/admin/dept/main.html
@@ -163,13 +163,16 @@
/*表格的工具栏*/
table.on('toolbar(dept-table)', function (obj) {
+ console.log(obj)
if (obj.event === 'add') {
window.add()
} else if (obj.event === 'refresh') {
window.refresh()
} else if (obj.event === 'batchRemove') {
{#window.batchRemove(obj)#}
- console.log(table.checkStatus(obj.config.id).data)
+ layer.msg('禁止批量删除')
+ return false
+ {#console.log(table.checkStatus(obj.config.id).data)#}
}
})
diff --git a/applications/templates/admin/dict/add.html b/applications/templates/admin/dict/add.html
index 4722d80..e2a3a21 100644
--- a/applications/templates/admin/dict/add.html
+++ b/applications/templates/admin/dict/add.html
@@ -69,7 +69,7 @@
success: function (result) {
if (result.success) {
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
- parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
+ parent.layer.close(parent.layer.getFrameIndex(window.name)) //关闭当前页
parent.layui.table.reload('dict-type-table')
})
} else {
diff --git a/applications/templates/admin/dict/main.html b/applications/templates/admin/dict/main.html
index bfe2f32..7294521 100644
--- a/applications/templates/admin/dict/main.html
+++ b/applications/templates/admin/dict/main.html
@@ -92,7 +92,9 @@
@@ -108,9 +110,11 @@
diff --git a/applications/templates/admin/photo/photo.html b/applications/templates/admin/file/photo.html
similarity index 99%
rename from applications/templates/admin/photo/photo.html
rename to applications/templates/admin/file/photo.html
index 7ae39ad..a4f77a1 100644
--- a/applications/templates/admin/photo/photo.html
+++ b/applications/templates/admin/file/photo.html
@@ -210,7 +210,7 @@
layer.close(index)
let loading = layer.load()
$.ajax({
- url: "{{ url_for('adminFile.batch_remove') }}",
+ url: "{{ url_for('file.batch_remove') }}",
data: { ids: ids },
dataType: 'json',
type: 'POST',
diff --git a/applications/templates/admin/photo/photo_add.html b/applications/templates/admin/file/photo_add.html
similarity index 97%
rename from applications/templates/admin/photo/photo_add.html
rename to applications/templates/admin/file/photo_add.html
index 77469ae..20d343b 100644
--- a/applications/templates/admin/photo/photo_add.html
+++ b/applications/templates/admin/file/photo_add.html
@@ -43,7 +43,7 @@
//选完文件后不自动上传
upload.render({
elem: '#logo-img'
- , url: "{{ url_for('adminFile.upload') }}"
+ , url: "{{ url_for('file.upload') }}"
, auto: false
, exts: 'jpg|png|gif|bmp|jpeg'
, size: 1000
diff --git a/applications/templates/admin/index.html b/applications/templates/admin/index.html
index 578e7a9..37957e4 100644
--- a/applications/templates/admin/index.html
+++ b/applications/templates/admin/index.html
@@ -17,9 +17,12 @@