fixed:post req
parent
8253d41573
commit
7acf413b3c
|
|
@ -105,11 +105,12 @@
|
||||||
<!--js逻辑-->
|
<!--js逻辑-->
|
||||||
<script src="../../lib/layui/layui.js"></script>
|
<script src="../../lib/layui/layui.js"></script>
|
||||||
<script>
|
<script>
|
||||||
layui.use(["element", "form", "laydate", "okLayer", "okUtils"], function () {
|
layui.use(["element", "form", "laydate", "okLayer", "okUtils", "okMock"], function () {
|
||||||
var form = layui.form;
|
let form = layui.form;
|
||||||
var laydate = layui.laydate;
|
let laydate = layui.laydate;
|
||||||
var okLayer = layui.okLayer;
|
let okLayer = layui.okLayer;
|
||||||
var okUtils = layui.okUtils;
|
let okUtils = layui.okUtils;
|
||||||
|
let okMock = layui.okMock;
|
||||||
|
|
||||||
laydate.render({elem: "#birthday", type: "datetime"});
|
laydate.render({elem: "#birthday", type: "datetime"});
|
||||||
|
|
||||||
|
|
@ -118,7 +119,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
form.on("submit(add)", function (data) {
|
form.on("submit(add)", function (data) {
|
||||||
okUtils.ajax(okUtils.mockApi.user.add, "post", data.field).done(function (response) {
|
okUtils.ajax(okMock.api.user.add, "post", data.field, true).done(function (response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
okLayer.msg.greenTick("添加成功", function () {
|
okLayer.msg.greenTick("添加成功", function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue