'wip(semantic):调整模板api接口'
This commit is contained in:
@@ -49,7 +49,7 @@ class Departments(Resource):
|
||||
db.session.add(dept)
|
||||
db.session.commit()
|
||||
|
||||
return success_api(msg="成功")
|
||||
return success_api(message="成功")
|
||||
|
||||
|
||||
class Department(Resource):
|
||||
@@ -67,7 +67,7 @@ class Department(Resource):
|
||||
'address': dept.address,
|
||||
}
|
||||
# return make_response(render_template('department/edit.html', dept=dept))
|
||||
return jsonify(success=True, msg='ok', dept=dept_data)
|
||||
return dict(success=True, message='ok', dept=dept_data)
|
||||
|
||||
@authorize("admin:dept:edit", log=True)
|
||||
def put(self, dept_id):
|
||||
@@ -92,9 +92,9 @@ class Department(Resource):
|
||||
}
|
||||
res = CompanyDepartment.query.filter_by(id=dept_id).update(data)
|
||||
if not res:
|
||||
return fail_api(msg="更新失败")
|
||||
return fail_api(message="更新失败")
|
||||
db.session.commit()
|
||||
return success_api(msg="更新成功")
|
||||
return success_api(message="更新成功")
|
||||
|
||||
@authorize("admin:dept:remove", log=True)
|
||||
def delete(self, dept_id):
|
||||
@@ -102,8 +102,8 @@ class Department(Resource):
|
||||
CompanyUser.query.filter_by(dept_id=dept_id).update({"dept_id": None})
|
||||
db.session.commit()
|
||||
if ret:
|
||||
return success_api(msg="删除成功")
|
||||
return fail_api(msg="删除失败")
|
||||
return success_api(message="删除成功")
|
||||
return fail_api(message="删除失败")
|
||||
|
||||
|
||||
class DeptEnable(Resource):
|
||||
@@ -114,5 +114,5 @@ class DeptEnable(Resource):
|
||||
d.status = not d.status
|
||||
db.session.commit()
|
||||
message = '修改成功'
|
||||
return success_api(msg=message)
|
||||
return fail_api(msg="出错啦")
|
||||
return success_api(message=message)
|
||||
return fail_api(message="出错啦")
|
||||
|
||||
@@ -166,13 +166,13 @@ class RightRights(Resource):
|
||||
"data": power_data
|
||||
|
||||
}
|
||||
return jsonify(res)
|
||||
return res
|
||||
|
||||
@authorize("admin:power:remove", log=True)
|
||||
def delete(self):
|
||||
ids = request.form.getlist('ids[]')
|
||||
batch_remove_power(ids)
|
||||
return success_api(msg="批量删除成功")
|
||||
return success_api(message="批量删除成功")
|
||||
|
||||
|
||||
class RightPower(Resource):
|
||||
@@ -196,9 +196,9 @@ class RightPower(Resource):
|
||||
db.session.commit()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return fail_api(msg='数据提交失败')
|
||||
return fail_api(message='数据提交失败')
|
||||
|
||||
return success_api(msg="成功")
|
||||
return success_api(message="成功")
|
||||
|
||||
@authorize("admin:power:remove", log=True)
|
||||
def delete(self, power_id):
|
||||
@@ -215,9 +215,9 @@ class RightPower(Resource):
|
||||
db.session.commit()
|
||||
|
||||
if r:
|
||||
return success_api(msg="删除成功")
|
||||
return success_api(message="删除成功")
|
||||
else:
|
||||
return fail_api(msg="删除失败")
|
||||
return fail_api(message="删除失败")
|
||||
|
||||
@authorize("admin:power:edit", log=True)
|
||||
def put(self, power_id):
|
||||
@@ -237,8 +237,8 @@ class RightPower(Resource):
|
||||
db.session.commit()
|
||||
|
||||
if not power:
|
||||
return fail_api(msg="更新权限失败")
|
||||
return success_api(msg="更新权限成功")
|
||||
return fail_api(message="更新权限失败")
|
||||
return success_api(message="更新权限成功")
|
||||
|
||||
|
||||
class RightPowerEnable(Resource):
|
||||
@@ -250,9 +250,9 @@ class RightPowerEnable(Resource):
|
||||
power.enable = not power.enable
|
||||
db.session.commit()
|
||||
message = "修改成功"
|
||||
return success_api(msg=message)
|
||||
return success_api(message=message)
|
||||
else:
|
||||
return fail_api(msg="出错啦")
|
||||
return fail_api(message="出错啦")
|
||||
|
||||
|
||||
class AdminConfigs(Resource):
|
||||
|
||||
@@ -57,18 +57,16 @@ class RoleRoles(Resource):
|
||||
|
||||
paginate = RightsRole.query.filter(*filters).paginate(page=res.page, per_page=res.limit, error_out=False)
|
||||
|
||||
return table_api(data=[
|
||||
{
|
||||
'id': item.id,
|
||||
'roleName': item.name,
|
||||
'roleCode': item.code,
|
||||
'enable': item.enable,
|
||||
'remark': item.remark,
|
||||
'details': item.details,
|
||||
'sort': item.sort,
|
||||
'create_at': item.create_at,
|
||||
} for item in paginate.items
|
||||
], count=paginate.total, code=0)
|
||||
return table_api(result={'items': [{'id': item.id,
|
||||
'roleName': item.name,
|
||||
'roleCode': item.code,
|
||||
'enable': item.enable,
|
||||
'remark': item.remark,
|
||||
'details': item.details,
|
||||
'sort': item.sort,
|
||||
'create_at': str(item.create_at), } for item in paginate.items],
|
||||
'total': paginate.total}
|
||||
, code=0)
|
||||
|
||||
@authorize("admin:role:remove", log=True)
|
||||
@login_required
|
||||
@@ -79,7 +77,7 @@ class RoleRoles(Resource):
|
||||
res = parser.parse_args()
|
||||
|
||||
batch_remove_role(res.ids)
|
||||
return success_api(msg="批量删除成功")
|
||||
return success_api(message="批量删除成功")
|
||||
|
||||
|
||||
class RoleRole(Resource):
|
||||
@@ -104,7 +102,7 @@ class RoleRole(Resource):
|
||||
)
|
||||
db.session.add(role)
|
||||
db.session.commit()
|
||||
return success_api(msg="成功")
|
||||
return success_api(message="成功")
|
||||
|
||||
# 更新角色
|
||||
@authorize("admin:role:edit", log=True)
|
||||
@@ -130,8 +128,8 @@ class RoleRole(Resource):
|
||||
role = RightsRole.query.filter_by(id=role_id).update(data)
|
||||
db.session.commit()
|
||||
if not role:
|
||||
return fail_api(msg="更新角色失败")
|
||||
return success_api(msg="更新角色成功")
|
||||
return fail_api(message="更新角色失败")
|
||||
return success_api(message="更新角色成功")
|
||||
|
||||
|
||||
class RoleEnable(Resource):
|
||||
@@ -145,8 +143,8 @@ class RoleEnable(Resource):
|
||||
|
||||
message = "修改成功"
|
||||
if not ret:
|
||||
return fail_api(msg="出错啦")
|
||||
return success_api(msg=message)
|
||||
return fail_api(message="出错啦")
|
||||
return success_api(message=message)
|
||||
|
||||
|
||||
class RolePower(Resource):
|
||||
@@ -158,20 +156,16 @@ class RolePower(Resource):
|
||||
# 获取权限列表的 id
|
||||
check_powers_list = [rp.id for rp in role.power]
|
||||
powers = RightsPower.query.all() # 获取所有的权限
|
||||
# power_schema = PowerSchema2(many=True) # 用已继承 ma.ModelSchema 类的自定制类生成序列化类
|
||||
# 将所有的权限生产可序列化对象 json
|
||||
# powers = power_schema.dump(powers) # 生成可序列化对象
|
||||
powers = marshal(powers, power_fields)
|
||||
for i in powers:
|
||||
if int(i.get("powerId")) in check_powers_list:
|
||||
i["checkArr"] = "1"
|
||||
else:
|
||||
i["checkArr"] = "0"
|
||||
res = {
|
||||
return {
|
||||
"data": powers,
|
||||
"status": {"code": 200, "message": "默认"}
|
||||
}
|
||||
return jsonify(res)
|
||||
|
||||
# 保存角色权限
|
||||
@authorize("admin:role:edit", log=True)
|
||||
@@ -195,7 +189,7 @@ class RolePower(Resource):
|
||||
for p in powers:
|
||||
role.power.append(p)
|
||||
db.session.commit()
|
||||
return success_api(msg="授权成功")
|
||||
return success_api(message="授权成功")
|
||||
|
||||
# 角色删除
|
||||
@authorize("admin:role:remove", log=True)
|
||||
@@ -204,5 +198,5 @@ class RolePower(Resource):
|
||||
res = remove_role(role_id)
|
||||
print(res)
|
||||
if not res:
|
||||
return fail_api(msg="角色删除失败")
|
||||
return success_api(msg="角色删除成功")
|
||||
return fail_api(message="角色删除失败")
|
||||
return success_api(message="角色删除成功")
|
||||
|
||||
@@ -21,7 +21,9 @@ class FilePhotos(Resource):
|
||||
photo_paginate = FilePhoto.query.order_by(desc(FilePhoto.create_at)).paginate(page=page, per_page=limit,
|
||||
error_out=False)
|
||||
data = marshal(photo_paginate.items, photo_fields)
|
||||
return table_api(data=data, count=photo_paginate.total, code=0)
|
||||
return table_api(result={'items': data,
|
||||
'total': photo_paginate.total, },
|
||||
code=0)
|
||||
|
||||
@authorize("admin:file:add", log=True)
|
||||
def post(self):
|
||||
|
||||
@@ -18,7 +18,6 @@ class Login(Resource):
|
||||
def get(self):
|
||||
if current_user.is_authenticated:
|
||||
return redirect(url_for('admin.index'))
|
||||
# TODO 分离视图操作 最终实现接口登录与视图登录两套逻辑
|
||||
return make_response(render_template('index/login.html'))
|
||||
|
||||
def post(self):
|
||||
@@ -28,14 +27,14 @@ class Login(Resource):
|
||||
s_code = session.get("code", None)
|
||||
|
||||
if req.captcha != s_code:
|
||||
return fail_api(msg="验证码错误")
|
||||
return fail_api(message="验证码错误")
|
||||
user = CompanyUser.query.filter_by(username=req.username).first()
|
||||
|
||||
if user is None:
|
||||
return fail_api(msg="不存在的用户")
|
||||
return fail_api(message="不存在的用户")
|
||||
|
||||
if user.enable == 0:
|
||||
return fail_api(msg="用户被暂停使用")
|
||||
return fail_api(message="用户被暂停使用")
|
||||
|
||||
if user.validate_password(req.password):
|
||||
# 登录
|
||||
@@ -45,6 +44,6 @@ class Login(Resource):
|
||||
|
||||
# 存入权限
|
||||
add_auth_session()
|
||||
return success_api(msg="登录成功")
|
||||
return success_api(message="登录成功")
|
||||
record_logging()
|
||||
return fail_api(msg="用户名或密码错误")
|
||||
return fail_api(message="用户名或密码错误")
|
||||
|
||||
@@ -21,14 +21,14 @@ class UserStatus(Resource):
|
||||
if res.operate == 1:
|
||||
user = CompanyUser.query.get(user_id)
|
||||
user.enable = res.operate
|
||||
message = success_api(msg="启动成功")
|
||||
message = success_api(message="启动成功")
|
||||
else:
|
||||
user = CompanyUser.query.filter_by(id=res.user_id).update({"enable": res.operate})
|
||||
message = success_api(msg="禁用成功")
|
||||
message = success_api(message="禁用成功")
|
||||
if user:
|
||||
db.session.commit()
|
||||
else:
|
||||
return fail_api(msg="出错啦")
|
||||
return fail_api(message="出错啦")
|
||||
return message
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ class UserAvatar(Resource):
|
||||
ret.avatar = url
|
||||
db.session.commit()
|
||||
if not ret:
|
||||
return fail_api(msg="出错啦")
|
||||
return success_api(msg="修改成功")
|
||||
return fail_api(message="出错啦")
|
||||
return success_api(message="修改成功")
|
||||
|
||||
|
||||
class UserInfo(Resource):
|
||||
@@ -63,8 +63,8 @@ class UserInfo(Resource):
|
||||
ret.remark = res.details
|
||||
db.session.commit()
|
||||
if not ret:
|
||||
return fail_api(msg="出错啦")
|
||||
return success_api(msg="更新成功")
|
||||
return fail_api(message="出错啦")
|
||||
return success_api(message="更新成功")
|
||||
|
||||
|
||||
class UserPassword(Resource):
|
||||
@@ -80,15 +80,15 @@ class UserPassword(Resource):
|
||||
res = parser.parse_args()
|
||||
|
||||
if res.newPassword != res.confirmPassword:
|
||||
return fail_api(msg='确认密码不一致')
|
||||
return fail_api(message='确认密码不一致')
|
||||
|
||||
""" 修改当前用户密码 """
|
||||
user = CompanyUser.query.get(user_id)
|
||||
is_right = user.validate_password(res.oldPassword)
|
||||
if not is_right:
|
||||
return jsonify(success=False, msg="旧密码错误")
|
||||
return jsonify(success=False, message="旧密码错误")
|
||||
user.set_password(res.newPassword)
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
|
||||
return jsonify(success=True, msg="更改成功")
|
||||
return jsonify(success=True, message="更改成功")
|
||||
|
||||
@@ -90,12 +90,13 @@ class UserUsers(Resource):
|
||||
'username': item.username,
|
||||
'realname': item.realname,
|
||||
'enable': item.enable,
|
||||
'create_at': item.create_at,
|
||||
'update_at': item.update_at,
|
||||
'create_at': str(item.create_at),
|
||||
'update_at': str(item.update_at),
|
||||
'dept': dept_name(item.dept_id),
|
||||
} for item in paginate.items]
|
||||
|
||||
return table_api(data=user_data, count=paginate.total, code=0)
|
||||
return table_api(result={'items': user_data,
|
||||
'total': paginate.total}
|
||||
, code=0)
|
||||
|
||||
@authorize("admin:user:add", log=True)
|
||||
def post(self):
|
||||
@@ -111,7 +112,7 @@ class UserUsers(Resource):
|
||||
role_ids = res.role_ids.split(',')
|
||||
|
||||
if is_user_exists(res.username):
|
||||
return fail_api(msg="用户已经存在")
|
||||
return fail_api(message="用户已经存在")
|
||||
|
||||
user = CompanyUser()
|
||||
user.username = res.username
|
||||
@@ -127,14 +128,14 @@ class UserUsers(Resource):
|
||||
user.role.append(r)
|
||||
db.session.commit()
|
||||
|
||||
return success_api(msg="增加成功", code=0)
|
||||
return success_api(message="增加成功", code=0)
|
||||
|
||||
@authorize("admin:user:remove", log=True)
|
||||
def delete(self):
|
||||
"""批量删除"""
|
||||
ids = request.form.getlist('ids[]')
|
||||
batch_remove(ids)
|
||||
return success_api(msg="批量删除成功")
|
||||
return success_api(message="批量删除成功")
|
||||
|
||||
|
||||
class UserUser(Resource):
|
||||
@@ -154,7 +155,7 @@ class UserUser(Resource):
|
||||
role_ids = res.role_ids.split(',')
|
||||
|
||||
if is_user_exists(res.username):
|
||||
return fail_api(msg="用户已经存在")
|
||||
return fail_api(message="用户已经存在")
|
||||
|
||||
user = CompanyUser()
|
||||
user.username = res.username
|
||||
@@ -170,15 +171,15 @@ class UserUser(Resource):
|
||||
user.role.append(r)
|
||||
db.session.commit()
|
||||
|
||||
return success_api(msg="增加成功", code=0)
|
||||
return success_api(message="增加成功", code=0)
|
||||
|
||||
@authorize("admin:user:remove", log=True)
|
||||
def delete(self, user_id):
|
||||
# 删除用户
|
||||
res = delete_by_id(user_id)
|
||||
if not res:
|
||||
return fail_api(msg="删除失败")
|
||||
return success_api(msg="删除成功")
|
||||
return fail_api(message="删除失败")
|
||||
return success_api(message="删除成功")
|
||||
|
||||
|
||||
class UserRole(Resource):
|
||||
@@ -202,4 +203,4 @@ class UserRole(Resource):
|
||||
|
||||
update_user_role(user_id, role_ids)
|
||||
|
||||
return success_api(msg="更新成功")
|
||||
return success_api(message="更新成功")
|
||||
|
||||
@@ -1,32 +1,36 @@
|
||||
from flask import jsonify
|
||||
|
||||
"""
|
||||
{
|
||||
'success': True,
|
||||
'code': 10002,
|
||||
'msg': '提示消息',
|
||||
'data':[] or {}
|
||||
}
|
||||
"""
|
||||
import typing as t
|
||||
|
||||
|
||||
def success_api(msg: str = "成功", code=200):
|
||||
def success_api(message: str = "成功", code: int = 200) -> t.Dict:
|
||||
""" 成功响应 默认值”成功“ """
|
||||
return jsonify(success=True, msg=msg, code=200)
|
||||
return dict(success=True, message=message, code=code)
|
||||
|
||||
|
||||
def fail_api(msg: str = "失败", code=404):
|
||||
def fail_api(message: str = "失败", code: int = 404) -> t.Dict:
|
||||
""" 失败响应 默认值“失败” """
|
||||
return jsonify(success=False, msg=msg, code=404)
|
||||
return dict(success=False, message=message, code=code)
|
||||
|
||||
|
||||
def table_api(msg: str = "", count=0, data=None, limit=10, code=200):
|
||||
""" 动态表格渲染响应 """
|
||||
res = {
|
||||
'msg': msg,
|
||||
def table_api(success: bool = True,
|
||||
message: str = "",
|
||||
result: t.Union[dict, list] = None,
|
||||
code: int = 0) -> t.Dict:
|
||||
"""
|
||||
动态表格渲染响应
|
||||
此方法返回数据给前端
|
||||
{
|
||||
'success': True,
|
||||
'code': 10002,
|
||||
'message': '提示消息',
|
||||
'result':{'items':[],'total': 100}
|
||||
}
|
||||
|
||||
注:lay_ui 表格数据需要指定 code=0
|
||||
"""
|
||||
ret = {
|
||||
'success': success,
|
||||
'message': message,
|
||||
'code': code,
|
||||
'data': data,
|
||||
'count': count,
|
||||
'limit': limit
|
||||
'result': result,
|
||||
}
|
||||
return jsonify(res)
|
||||
return ret
|
||||
|
||||
@@ -27,7 +27,9 @@ def login_log():
|
||||
page=page, per_page=limit, error_out=False)
|
||||
data = marshal(log_paginate.items, log_fields)
|
||||
|
||||
return table_api(data=data, count=log_paginate.total, code=0)
|
||||
return table_api(result={'items': data,
|
||||
'total': log_paginate.total, },
|
||||
code=0)
|
||||
|
||||
|
||||
@logs_bp.get('/access_log')
|
||||
@@ -40,4 +42,6 @@ def operate_log():
|
||||
desc(LoggingModel.create_at)).paginate(
|
||||
page=page, per_page=limit, error_out=False)
|
||||
data = marshal(log_paginate.items, log_fields)
|
||||
return table_api(data=data, count=log_paginate.total, code=0)
|
||||
return table_api(result={'items': data,
|
||||
'total': log_paginate.total, },
|
||||
code=0)
|
||||
|
||||
@@ -21,7 +21,7 @@ def get_captcha():
|
||||
def logout():
|
||||
logout_user()
|
||||
session.pop('permissions')
|
||||
return success_api(msg="注销成功")
|
||||
return success_api(message="注销成功")
|
||||
|
||||
|
||||
@index_bp.get('/passport/login')
|
||||
|
||||
+20
-11
@@ -14,7 +14,7 @@ class Department {
|
||||
this.DEPARTMENT_API = {
|
||||
'DEPARTMENTS': () => `${this.DEPARTMENT_PATH}/departments`,
|
||||
'DEPARTMENT': (dept_id) => `${this.DEPARTMENT_PATH}/department/${dept_id}`,
|
||||
'DEPARTMENT_STATUS': (dept_id) => `${this.DEPARTMENT_PATH}/department/${dept_id}/status`
|
||||
'DEPARTMENT_STATUS': (dept_id) => `${this.DEPARTMENT_PATH}/department/${dept_id}/status`,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class Rights {
|
||||
this.RIGHTS_API = {
|
||||
'RIGHTS': () => `${this.DEPARTMENT_PATH}/rights`,
|
||||
'POWER': (power_id) => `${this.DEPARTMENT_PATH}/power/${power_id}`,
|
||||
'POWER_STATUS': (power_id) => `${this.DEPARTMENT_PATH}/power/${power_id}/status`
|
||||
'POWER_STATUS': (power_id) => `${this.DEPARTMENT_PATH}/power/${power_id}/status`,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,18 +37,16 @@ class Role {
|
||||
'ROLES': () => `${this.ROLE_PATH}/roles`,
|
||||
'ROLE': (role_id) => `${this.ROLE_PATH}/role/${role_id}`,
|
||||
'ROLE_STATUS': (role_id) => `${this.ROLE_PATH}/role/${role_id}/status`,
|
||||
'ROLE_POWER': (role_id) => `${this.ROLE_PATH}/role_power/${role_id}`
|
||||
'ROLE_POWER': (role_id) => `${this.ROLE_PATH}/role_power/${role_id}`,
|
||||
}
|
||||
}
|
||||
|
||||
async get_roles () {
|
||||
return fetch(this.ROLE_API.ROLES())
|
||||
.then(function (response) {
|
||||
return response.json()
|
||||
})
|
||||
.then(function (myJson) {
|
||||
return myJson
|
||||
})
|
||||
return fetch(this.ROLE_API.ROLES()).then(function (response) {
|
||||
return response.json()
|
||||
}).then(function (myJson) {
|
||||
return myJson
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,5 +81,16 @@ export {
|
||||
DEPARTMENT_API,
|
||||
RIGHTS, RIGHTS_API,
|
||||
ROLE, ROLE_API,
|
||||
USER, USER_API
|
||||
USER, USER_API,
|
||||
}
|
||||
|
||||
/******************数据解析********************************/
|
||||
export function parserTableData (res) { //res 即为原始返回的数据
|
||||
console.log('parserTableData', res)
|
||||
return {
|
||||
'code': res.code, //解析接口状态
|
||||
'msg': res.message, //解析提示文本
|
||||
'count': res.result.total, //解析数据长度
|
||||
'data': res.result.items, //解析数据列表
|
||||
}
|
||||
}
|
||||
@@ -39,15 +39,15 @@
|
||||
|
||||
|
||||
{#表格工具栏,需要在表格中绑定,且需要自定义事件#}
|
||||
<script type="text/html" id="toolbaes">
|
||||
<script type="text/html" id="toolbar">
|
||||
{% if authorize("admin:dept:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add_toggle">
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="toolbar-add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:dept:remove") %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="batch_remove">
|
||||
<button class="pear-btn pear-btn-md" lay-event="toolbar-remove">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
@@ -88,6 +88,19 @@
|
||||
let popup = layui.popup
|
||||
|
||||
let MODULE_PATH = '/dept/'
|
||||
const get_columns = () => [
|
||||
[
|
||||
{ type: 'checkbox' },
|
||||
{ field: 'deptName', minWidth: 200, title: '部门名称' },
|
||||
{ field: 'leader', title: '负责人' },
|
||||
{ field: 'phone', title: '联系方式' },
|
||||
{ field: 'email', title: '邮箱' },
|
||||
{ field: 'address', title: '详细地址' },
|
||||
{ field: 'status', title: '状态', templet: '#dept-status' },
|
||||
{ field: 'sort', title: '排序', width: 100 },
|
||||
{ title: '操作', templet: '#tool', width: 120, align: 'center' },
|
||||
],
|
||||
]
|
||||
|
||||
{#定义表格渲染函数#}
|
||||
window.render = function () {
|
||||
@@ -100,23 +113,11 @@
|
||||
skin: 'line',
|
||||
method: 'post', /**/
|
||||
treeDefaultClose: false,
|
||||
toolbar: '#toolbaes', /*表格的工具栏*/
|
||||
toolbar: '#toolbar', /*表格的工具栏*/
|
||||
elem: '#tables', /*表格挂载的对象*/
|
||||
url: DEPARTMENT_API.DEPARTMENTS(), /*数据来源接口*/
|
||||
page: false,
|
||||
cols: [
|
||||
[
|
||||
{ type: 'checkbox' },
|
||||
{ field: 'deptName', minWidth: 200, title: '部门名称' },
|
||||
{ field: 'leader', title: '负责人' },
|
||||
{ field: 'phone', title: '联系方式' },
|
||||
{ field: 'email', title: '邮箱' },
|
||||
{ field: 'address', title: '详细地址' },
|
||||
{ field: 'status', title: '状态', templet: '#dept-status' },
|
||||
{ field: 'sort', title: '排序', width: 100 },
|
||||
{ title: '操作', templet: '#tool', width: 120, align: 'center' }
|
||||
]
|
||||
]/*表格渲染的数据*/
|
||||
cols: get_columns(),/*表格渲染的数据*/
|
||||
})
|
||||
}
|
||||
|
||||
@@ -167,12 +168,12 @@
|
||||
/*表格的工具栏*/
|
||||
table.on('toolbar(tables)', function (obj) {
|
||||
{#console.log(obj)#}
|
||||
if (obj.event === 'add_toggle') {
|
||||
window.add_toggle()
|
||||
if (obj.event === 'toolbar-add') {
|
||||
window.toolbar_add()
|
||||
} else if (obj.event === 'refresh') {
|
||||
window.refresh()
|
||||
} else if (obj.event === 'batch_remove') {
|
||||
{#window.batch_remove(obj)#}
|
||||
} else if (obj.event === 'toolbar-remove') {
|
||||
{#window.toolbar_remove(obj)#}
|
||||
layer.msg('禁止批量删除')
|
||||
return false
|
||||
{#console.log(table.checkStatus(obj.config.id).data)#}
|
||||
@@ -197,21 +198,21 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg)
|
||||
popup.success(result.message)
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
window.add_toggle = function () {
|
||||
window.toolbar_add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'], /*新增窗口的大小*/
|
||||
content: '/dept/add' /*新增窗口从那里来*/
|
||||
content: '/dept/add', /*新增窗口从那里来*/
|
||||
})
|
||||
}
|
||||
|
||||
@@ -222,7 +223,7 @@
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'],
|
||||
content: MODULE_PATH + 'edit?deptId=' + obj.data['deptId'] /*编辑修改窗口从那里来*/
|
||||
content: MODULE_PATH + 'edit?deptId=' + obj.data['deptId'], /*编辑修改窗口从那里来*/
|
||||
})
|
||||
|
||||
}
|
||||
@@ -238,13 +239,13 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -111,12 +111,12 @@
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||
parent.render()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -111,12 +111,12 @@
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.render()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
import { FILE_API } from '/static/api/http.js'
|
||||
import { FILE_API, parserTableData as parseData } from '/static/api/http.js'
|
||||
|
||||
layui.use(['table', 'form', 'jquery', 'element', 'form', 'upload'], function () {
|
||||
let table = layui.table
|
||||
@@ -39,7 +39,7 @@
|
||||
let $ = layui.jquery
|
||||
let upload = layui.upload
|
||||
|
||||
let cols = [
|
||||
const get_columns = () => [
|
||||
[
|
||||
{
|
||||
type: 'checkbox',
|
||||
@@ -98,10 +98,11 @@
|
||||
]
|
||||
|
||||
table.render({
|
||||
parseData,
|
||||
elem: '#tables',
|
||||
url: FILE_API.PHOTOS(),
|
||||
page: true,
|
||||
cols: cols,
|
||||
cols: get_columns(),
|
||||
skin: 'line',
|
||||
toolbar: '#toolbar',
|
||||
defaultToolbar: [
|
||||
|
||||
@@ -51,12 +51,12 @@
|
||||
, bindAction: '#logo-upload-button'
|
||||
, done: function (res) {
|
||||
if (res.success) {
|
||||
layer.msg(res.msg, { icon: 1, time: 500 }, function () {
|
||||
layer.msg(res.message, { icon: 1, time: 500 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
window.parent.location.reload()
|
||||
})
|
||||
} else {
|
||||
layer.msg(res.msg, { icon: 2 })
|
||||
layer.msg(res.message, { icon: 2 })
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -40,14 +40,16 @@
|
||||
{{# } }}'|safe }}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
<script type="module">
|
||||
import { parserTableData as parseData } from '/static/api/http.js'
|
||||
|
||||
layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
|
||||
let MODULE_PATH = '/logs/'
|
||||
|
||||
let cols = [
|
||||
const get_columns = () => [
|
||||
[
|
||||
{ title: 'ID', field: 'id', align: 'center' },
|
||||
{ title: '请求方式', field: 'method', align: 'center' },
|
||||
@@ -62,19 +64,21 @@
|
||||
]
|
||||
|
||||
table.render({
|
||||
parseData,
|
||||
elem: '#log-access-table',
|
||||
url: MODULE_PATH + 'access_log',
|
||||
page: true,
|
||||
cols: cols,
|
||||
cols: get_columns(),
|
||||
skin: 'line',
|
||||
toolbar: false,
|
||||
})
|
||||
|
||||
table.render({
|
||||
parseData,
|
||||
elem: '#log-login-table',
|
||||
url: MODULE_PATH + 'login_log',
|
||||
page: true,
|
||||
cols: cols,
|
||||
cols: get_columns(),
|
||||
skin: 'line',
|
||||
toolbar: false,
|
||||
})
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
import { RIGHTS_API } from '/static/api/http.js'
|
||||
import { RIGHTS_API, parserTableData as parseData } from '/static/api/http.js'
|
||||
|
||||
layui.use(['table', 'form', 'jquery', 'treetable', 'popup', 'dtree', 'iconPicker'], function () {
|
||||
let table = layui.table
|
||||
@@ -65,50 +65,48 @@
|
||||
let iconPicker = layui.iconPicker
|
||||
let dtree = layui.dtree
|
||||
|
||||
window.render = function () {
|
||||
treetable.render({
|
||||
treeColIndex: 1,
|
||||
treeSpid: 0,
|
||||
treeIdName: 'powerId',
|
||||
treePidName: 'parentId',
|
||||
skin: 'line',
|
||||
method: 'post',
|
||||
treeDefaultClose: true,
|
||||
toolbar: '#toolbar',
|
||||
elem: '#tables',
|
||||
url: RIGHTS_API.RIGHTS(),
|
||||
page: false,
|
||||
cols: [
|
||||
[
|
||||
{ type: 'checkbox' },
|
||||
{ field: 'powerName', minWidth: 200, title: '权限名称' },
|
||||
{ field: 'icon', title: '图标', templet: (d) => `<i class="layui-icon ${d.icon}"></i>` },
|
||||
{
|
||||
field: 'powerType', title: '权限类型', templet: (d) => {
|
||||
if (d.powerType === '0') {
|
||||
return `<span>目录</span>`
|
||||
} else if (d.powerType === '1') {
|
||||
return `<span>菜单</span>`
|
||||
} else if (d.powerType === '2') {
|
||||
return `<span>按钮</span>`
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'enable', title: '是否可用', templet: (d) => {
|
||||
// TODO 修改禁用启动逻辑
|
||||
return `<input type="checkbox" name="enable" value="${d.powerId}" lay-skin="switch" lay-text="启用|禁用" lay-filter="tool-switch" ${d.enable ===
|
||||
1 ? 'checked=checked' : ''}>`
|
||||
},
|
||||
},
|
||||
{ field: 'sort', title: '排序' },
|
||||
{ title: '操作', templet: '#tool', width: 150, align: 'center' },
|
||||
],
|
||||
],
|
||||
})
|
||||
}
|
||||
const get_columns = () => [
|
||||
[
|
||||
{ type: 'checkbox' },
|
||||
{ field: 'powerName', minWidth: 200, title: '权限名称' },
|
||||
{ field: 'icon', title: '图标', templet: (d) => `<i class="layui-icon ${d.icon}"></i>` },
|
||||
{
|
||||
field: 'powerType', title: '权限类型', templet: (d) => {
|
||||
if (d.powerType === '0') {
|
||||
return `<span>目录</span>`
|
||||
} else if (d.powerType === '1') {
|
||||
return `<span>菜单</span>`
|
||||
} else if (d.powerType === '2') {
|
||||
return `<span>按钮</span>`
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'enable', title: '是否可用', templet: (d) => {
|
||||
// TODO 修改禁用启动逻辑
|
||||
return `<input type="checkbox" name="enable" value="${d.powerId}" lay-skin="switch" lay-text="启用|禁用" lay-filter="tool-switch" ${d.enable ===
|
||||
1 ? 'checked=checked' : ''}>`
|
||||
},
|
||||
},
|
||||
{ field: 'sort', title: '排序' },
|
||||
{ title: '操作', templet: '#tool', width: 150, align: 'center' },
|
||||
],
|
||||
]
|
||||
|
||||
render()
|
||||
treetable.render({
|
||||
treeColIndex: 1,
|
||||
treeSpid: 0,
|
||||
treeIdName: 'powerId',
|
||||
treePidName: 'parentId',
|
||||
skin: 'line',
|
||||
method: 'post',
|
||||
treeDefaultClose: true,
|
||||
toolbar: '#toolbar',
|
||||
elem: '#tables',
|
||||
url: RIGHTS_API.RIGHTS(),
|
||||
page: false,
|
||||
cols: get_columns(),
|
||||
})
|
||||
|
||||
form.on('submit(power_query)', function (data) {
|
||||
var keyword = data.field.powerName
|
||||
@@ -173,9 +171,9 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg)
|
||||
popup.success(result.message)
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -211,12 +209,12 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
console.log(obj)
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -138,12 +138,12 @@
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.render()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -153,12 +153,12 @@
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.render()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
import { ROLE_API } from '/static/api/http.js'
|
||||
import { ROLE_API, parserTableData as parseData } from '/static/api/http.js'
|
||||
|
||||
layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
@@ -72,7 +72,7 @@
|
||||
let $ = layui.jquery
|
||||
let popup = layui.popup
|
||||
|
||||
let cols = [
|
||||
const get_columns = () => [
|
||||
[
|
||||
{ type: 'checkbox' },
|
||||
{ title: '角色名', field: 'roleName', align: 'center', width: 100 },
|
||||
@@ -85,10 +85,11 @@
|
||||
]
|
||||
|
||||
table.render({
|
||||
parseData,
|
||||
elem: '#tables',
|
||||
url: ROLE_API.ROLES(),
|
||||
page: true,
|
||||
cols: cols,
|
||||
cols: get_columns(),
|
||||
skin: 'line',
|
||||
toolbar: '#toolbar',
|
||||
defaultToolbar: [
|
||||
@@ -140,9 +141,9 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 })
|
||||
layer.msg(result.message, { icon: 1, time: 1000 })
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -189,11 +190,11 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -233,11 +234,11 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
table.reload('tables')
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -76,12 +76,12 @@
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.layui.table.reload('role-table')
|
||||
parent.layui.table.reload('tables')
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -91,12 +91,12 @@
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.layui.table.reload('role-table')
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -68,11 +68,11 @@
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -300,12 +300,12 @@
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
// TODO 关闭修改密码成之后的窗口
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
import { USER_API, ROLE } from '/static/api/http.js'
|
||||
import { USER_API, ROLE, parserTableData as parseData } from '/static/api/http.js'
|
||||
|
||||
layui.use(['table', 'dtree', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
@@ -105,7 +105,7 @@
|
||||
let common = layui.common
|
||||
|
||||
// 表格数据
|
||||
let cols = [
|
||||
const get_columns = () => [
|
||||
[
|
||||
{ type: 'checkbox' },
|
||||
{ title: '姓名', field: 'realname', align: 'center', width: 110 },
|
||||
@@ -120,10 +120,11 @@
|
||||
|
||||
// 渲染表格数据
|
||||
table.render({
|
||||
parseData,
|
||||
elem: '#tables',
|
||||
url: USER_API.USERS(),
|
||||
page: true,
|
||||
cols: cols,
|
||||
cols: get_columns(),
|
||||
skin: 'line',
|
||||
height: 'full-148',
|
||||
toolbar: '#toolbar', /*工具栏*/
|
||||
@@ -214,9 +215,9 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg)
|
||||
popup.success(result.message)
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -264,11 +265,11 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
table.reload('role-table')
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -289,11 +290,11 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
popup.failure(result.message)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -82,12 +82,12 @@
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||
parent.layui.table.reload('user-table')
|
||||
parent.layui.table.reload('tables')
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -105,12 +105,12 @@
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
layer.msg(result.message, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name)) //关闭当前页
|
||||
parent.layui.table.reload('user-table')
|
||||
parent.layui.table.reload('tables')
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
location.href = '/admin'
|
||||
})
|
||||
return true
|
||||
|
||||
@@ -61,11 +61,11 @@
|
||||
layer.close(loader) // 关闭加载按钮
|
||||
btn.stop(function () {
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
popup.success(result.message, function () {
|
||||
location.href = '/admin'
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg, function () {
|
||||
popup.failure(result.success, function () {
|
||||
document.getElementById('captchaImage').src = captchaPath + '?' + Math.random()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user