init
Showing
1 changed file
with
5 additions
and
9 deletions
| 1 | <?php | 1 | <?php |
| 2 | $this->load->view('common/header', ['styles' => [ | 2 | $this->load->view('common/header', array('styles' => array( |
| 3 | '/resource/login.css' | 3 | '/resource/login.css') |
| 4 | ]]); | 4 | )); |
| 5 | ?> | 5 | ?> |
| 6 | 6 | ||
| 7 | <body xmlns="http://www.w3.org/1999/html"> | 7 | <body xmlns="http://www.w3.org/1999/html"> |
| ... | @@ -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=" " id="edit"> | 16 | <form action="<?=$this->config->item('apiBaseUrl').'login'?>" 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> |
| ... | @@ -36,15 +36,11 @@ | ... | @@ -36,15 +36,11 @@ |
| 36 | //获得款中的节点 | 36 | //获得款中的节点 |
| 37 | var targetUrl = $("#edit").attr("action");//需要填写目的url | 37 | var targetUrl = $("#edit").attr("action");//需要填写目的url |
| 38 | var data = $("#edit").serializeJson(); | 38 | var data = $("#edit").serializeJson(); |
| 39 | var newData = { | ||
| 40 | username:data['nameZh'], | ||
| 41 | password:data['id'] | ||
| 42 | }; | ||
| 43 | $.ajax({ | 39 | $.ajax({ |
| 44 | type: 'post', | 40 | type: 'post', |
| 45 | url: apiBaseUrl + targetUrl, | 41 | url: apiBaseUrl + targetUrl, |
| 46 | cache: false, | 42 | cache: false, |
| 47 | data: JSON.stringify(newData), | 43 | data: JSON.stringify(data), |
| 48 | dataType: 'json', | 44 | dataType: 'json', |
| 49 | contentType: "application/json; charset=UTF-8", | 45 | contentType: "application/json; charset=UTF-8", |
| 50 | success: function (data) { | 46 | success: function (data) { | ... | ... |
-
Please register or sign in to post a comment