d9912690 by wang

init

1 parent b08860a7
......@@ -13,7 +13,7 @@
<div class="login_name">
<p>后台管理系统</p>
</div>
<form action="system/user/update" id="edit">
<form action=" " id="edit">
<input name="username" type="text" placeholder="用户名">
<input name="password" type="password" placeholder="密码">
</form>
......@@ -27,5 +27,50 @@
(推荐IE10以上浏览器或谷歌浏览器或firefox浏览器, 获得更快响应速度)
</div>
</div>
<?php $this->load->view('common/footer'); ?>
<script>
function save() {
//获得款中的节点
var targetUrl = $("#edit").attr("action");//需要填写目的url
var data = $("#edit").serializeJson();
var newData = {
username:data['nameZh'],
password:data['id']
};
$.ajax({
type: 'post',
url: apiBaseUrl + targetUrl,
cache: false,
data: JSON.stringify(newData),
dataType: 'json',
contentType: "application/json; charset=UTF-8",
success: function (data) {
// console.log(data);
if (data.msg) {
layer.alert(data.msg);
} else if (data.code != 0) {
layer.alert('操作失败');
} else {
layer.msg('操作成功');
// $.session.set('user_id', data['id']);
window.parent.reload();
layer_close();
}
if (data.code) {
setTimeout(function () {
window.parent.reload();
layer_close();
}, 500);
}
},
error: function () {
layer.alert("操作失败")
}
});
// layer_close();
}
</script>
</body>
</html>
\ No newline at end of file
......
......@@ -92,7 +92,6 @@
id:data['id'],
menuIds:menuIds
};
$.ajax({
type: 'put',
url: apiBaseUrl + targetUrl,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!