pbootcms會員中心登錄頁面模板核心代碼及位置
登錄頁面是login.html
核心代碼是
<form class="my-4" onsubmit="return login(this);"> <div class="form-group"> <label for="username">賬 號</label> <div> <input type="text" name="username" required id="username" class="form-control" placeholder="請輸入登錄用戶名/郵箱/手機(jī)號碼"> </div> </div> <div class="form-group"> <label for="password">密 碼</label> <div> <input type="password" name="password" required id="password" class="form-control" placeholder="請輸入登錄密碼"> </div> </div> {pboot@if({pboot:logincodestatus})} <div class="form-group"> <label for="checkcode">驗證碼</label> <div class="row"> <div class="col-6"> <input type="text" name="checkcode" required id="checkcode" class="form-control" placeholder="請輸入驗證碼"> </div> <div class="col-6"> <img title="點擊刷新" style="height:33px;" id="codeimg" src="{pboot:checkcode}" onclick="this.src='{pboot:checkcode}?'+Math.round(Math.random()*10);" /> </div> </div> </div> {/pboot@if} <div class="form-group"> <button type="submit" class="btn btn-info mb-2">立即登錄</button> <span class="text-secondary ml-3">沒有賬號?<a href="{pboot:register}">馬上注冊</a></span> </div> </form> <script> //ajax登錄 function login(obj){ var url='{pboot:login}'; var username=$(obj).find("#username").val(); var password=$(obj).find("#password").val(); var checkcode=$(obj).find("#checkcode").val(); $.ajax({ type: 'POST', url: url, dataType: 'json', data: { username: username, password: password, checkcode: checkcode }, success: function (response, status) { if(response.code){ alert("登錄成功!"); location.href=response.tourl; }else{ $('#codeimg').click(); alert(response.data); } }, error:function(xhr,status,error){ alert('返回數(shù)據(jù)異常!'); } }); return false; } </script>
如果您的問題還未解決可以聯(lián)系站長付費協(xié)助。

有問題可以加入技術(shù)QQ群一起交流學(xué)習(xí)
本站vip會員 請加入無憂模板網(wǎng) VIP群(50604020) PS:加入時備注用戶名或昵稱
普通注冊會員或訪客 請加入無憂模板網(wǎng) 技術(shù)交流群(50604130)
客服微信號:15898888535
聲明:本站所有文章資源內(nèi)容,如無特殊說明或標(biāo)注,均為采集網(wǎng)絡(luò)資源。如若內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系站長刪除。