Merge branch 'develop' of http://g.28ms.com:8000/yangjianbin/page into develop
Showing
2 changed files
with
48 additions
and
3 deletions
| ... | @@ -13,12 +13,12 @@ | ... | @@ -13,12 +13,12 @@ |
| 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> |
| 20 | <!-- <input value="登录" type="submit">--> | 20 | <!-- <input value="登录" type="submit">--> |
| 21 | <input value="登录" onclick="save()"> | 21 | <input value="登录" typ="submit" onclick="save()"> |
| 22 | 22 | ||
| 23 | </div> | 23 | </div> |
| 24 | <div class="copyright"> | 24 | <div class="copyright"> |
| ... | @@ -27,5 +27,51 @@ | ... | @@ -27,5 +27,51 @@ |
| 27 | (推荐IE10以上浏览器或谷歌浏览器或firefox浏览器, 获得更快响应速度) | 27 | (推荐IE10以上浏览器或谷歌浏览器或firefox浏览器, 获得更快响应速度) |
| 28 | </div> | 28 | </div> |
| 29 | </div> | 29 | </div> |
| 30 | |||
| 31 | |||
| 32 | <?php $this->load->view('common/footer'); ?> | ||
| 33 | <script> | ||
| 34 | function save() { | ||
| 35 | //获得款中的节点 | ||
| 36 | var targetUrl = $("#edit").attr("action");//需要填写目的url | ||
| 37 | var data = $("#edit").serializeJson(); | ||
| 38 | var newData = { | ||
| 39 | username:data['nameZh'], | ||
| 40 | password:data['id'] | ||
| 41 | }; | ||
| 42 | $.ajax({ | ||
| 43 | type: 'post', | ||
| 44 | url: apiBaseUrl + targetUrl, | ||
| 45 | cache: false, | ||
| 46 | data: JSON.stringify(newData), | ||
| 47 | dataType: 'json', | ||
| 48 | contentType: "application/json; charset=UTF-8", | ||
| 49 | success: function (data) { | ||
| 50 | // console.log(data); | ||
| 51 | if (data.msg) { | ||
| 52 | layer.alert(data.msg); | ||
| 53 | } else if (data.code != 0) { | ||
| 54 | layer.alert('操作失败'); | ||
| 55 | } else { | ||
| 56 | layer.msg('操作成功'); | ||
| 57 | // $.session.set('user_id', data['id']); | ||
| 58 | window.parent.reload(); | ||
| 59 | layer_close(); | ||
| 60 | } | ||
| 61 | if (data.code) { | ||
| 62 | setTimeout(function () { | ||
| 63 | window.parent.reload(); | ||
| 64 | layer_close(); | ||
| 65 | }, 500); | ||
| 66 | } | ||
| 67 | }, | ||
| 68 | error: function () { | ||
| 69 | layer.alert("操作失败") | ||
| 70 | } | ||
| 71 | }); | ||
| 72 | // layer_close(); | ||
| 73 | } | ||
| 74 | |||
| 75 | </script> | ||
| 30 | </body> | 76 | </body> |
| 31 | </html> | 77 | </html> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment