init
Showing
2 changed files
with
46 additions
and
2 deletions
| ... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
| 13 | <div class="login_name"> | 13 | <div class="login_name"> |
| 14 | <p>后台管理系统</p> | 14 | <p>后台管理系统</p> |
| 15 | </div> | 15 | </div> |
| 16 | <form action="system/user/update" id="edit"> | 16 | <form action=" " id="edit"> |
| 17 | <input name="username" type="text" placeholder="用户名"> | 17 | <input name="username" type="text" placeholder="用户名"> |
| 18 | <input name="password" type="password" placeholder="密码"> | 18 | <input name="password" type="password" placeholder="密码"> |
| 19 | </form> | 19 | </form> |
| ... | @@ -27,5 +27,50 @@ | ... | @@ -27,5 +27,50 @@ |
| 27 | (推荐IE10以上浏览器或谷歌浏览器或firefox浏览器, 获得更快响应速度) | 27 | (推荐IE10以上浏览器或谷歌浏览器或firefox浏览器, 获得更快响应速度) |
| 28 | </div> | 28 | </div> |
| 29 | </div> | 29 | </div> |
| 30 | |||
| 31 | <?php $this->load->view('common/footer'); ?> | ||
| 32 | <script> | ||
| 33 | function save() { | ||
| 34 | //获得款中的节点 | ||
| 35 | var targetUrl = $("#edit").attr("action");//需要填写目的url | ||
| 36 | var data = $("#edit").serializeJson(); | ||
| 37 | var newData = { | ||
| 38 | username:data['nameZh'], | ||
| 39 | password:data['id'] | ||
| 40 | }; | ||
| 41 | $.ajax({ | ||
| 42 | type: 'post', | ||
| 43 | url: apiBaseUrl + targetUrl, | ||
| 44 | cache: false, | ||
| 45 | data: JSON.stringify(newData), | ||
| 46 | dataType: 'json', | ||
| 47 | contentType: "application/json; charset=UTF-8", | ||
| 48 | success: function (data) { | ||
| 49 | // console.log(data); | ||
| 50 | if (data.msg) { | ||
| 51 | layer.alert(data.msg); | ||
| 52 | } else if (data.code != 0) { | ||
| 53 | layer.alert('操作失败'); | ||
| 54 | } else { | ||
| 55 | layer.msg('操作成功'); | ||
| 56 | // $.session.set('user_id', data['id']); | ||
| 57 | window.parent.reload(); | ||
| 58 | layer_close(); | ||
| 59 | } | ||
| 60 | if (data.code) { | ||
| 61 | setTimeout(function () { | ||
| 62 | window.parent.reload(); | ||
| 63 | layer_close(); | ||
| 64 | }, 500); | ||
| 65 | } | ||
| 66 | }, | ||
| 67 | error: function () { | ||
| 68 | layer.alert("操作失败") | ||
| 69 | } | ||
| 70 | }); | ||
| 71 | // layer_close(); | ||
| 72 | } | ||
| 73 | |||
| 74 | </script> | ||
| 30 | </body> | 75 | </body> |
| 31 | </html> | 76 | </html> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment