使用flask-restful实现数据校验与序列化3

This commit is contained in:
zhengxinonly
2021-06-27 19:27:08 +08:00
parent e9bd8a17a0
commit e3dd5458ad
23 changed files with 517 additions and 1202 deletions
+4 -3
View File
@@ -32,9 +32,9 @@
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="enable" {% if role.enable == 0 %}checked {% endif %}value="0"
<input type="radio" name="enable" {% if role.enable == 1 %}checked {% endif %}value="0"
title="开启">
<input type="radio" name="enable" {% if role.enable == 1 %}checked {% endif %} value="1"
<input type="radio" name="enable" {% if role.enable == 0 %}checked {% endif %} value="1"
title="关闭">
</div>
</div>
@@ -78,7 +78,7 @@
form.on('submit(role-update)', function (data) {
$.ajax({
url: '/admin/role/update',
url: '/admin/role/edit/' + data.field.roleId,
data: JSON.stringify(data.field),
dataType: 'json',
contentType: 'application/json',
@@ -96,6 +96,7 @@
})
return false
})
})
})
</script>
<script>