后臺(tái)登錄 login
{include file='public/header'/}
? ?
? ?<body style="background-color: #393D49">
? ? ? ?<div class="x-box">
? ? ? ? ? ?< div class="x-top">
? ? ? ? ? ? ? ?<i class="layui-icon x-login-close">
? ? ? ? ? ? ? ? ?ဇ
? ? ? ? ? ? ?</i>? ? ? ?<ul class="x-login- rechts">
? ? ? ? ? ? ? ? ? ?<li style="background-color: #F1C85F;" color="#F1C85F">
? ? ? ? ? ? ? ? ? ?</li>
? ? ? ? ? ? ? ? ? ?<li style="background-color: #EA569A;" color="#EA569A">
? ? ? ? ? ? ? ? ? ?</li>
? ? ? ? ? ? ? ? ? ?<li style="background-color: #393D49;" color="#393D49">
? ? ? ? ? ? ? ? ? ?</li>
? ? ? ? ? ? ? ?</ul>
? ? ? ? ? ?<div ">
? ? ? ? ? ? ? ?<div class="x-avtar" >
? ? ? ? ? ? ? ? ? ?<img src="__STATIC__/images/logo.png" alt="">
? ? ? ? ? ? ? ?</div>
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?;
? ? ? ? ? ? ? ? ? ? ? ? ? ?<Label für ="username" class="layui-form-label">
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <i class="layui-icon"></i>
? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ?<div class=" layui-input-inline">
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?;
? ? ? ? ? ? ? ? ? ? ? ? ? ?</ div>
? ? ? ? ? ? ? ? ? ? ? ?</div>
? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ?<i class="layui- icon"></i>
? ? ? ? ? ? ? ? ? ? ? ? ?</label>
? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ?<input type="password" id="password" name= "password" erforderlich=""
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? placeholder="******" class="layui-input">
? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ?</div>
? ? ? ? ? ? ? ? ? ? ? ?<div class="layui-form- item" id="loginbtn">
? ? ? ? ? ? ? ? ? ? ? ? ?登 錄
? ? ? ? ? ? ? ? ? ? ? ? ? ?< ;/button>
? ? ? ? ? ? ? ? ? ? ? ?</div>
? ? ? ? ? ? ? ? ?div>
? ? ? ?</div>
? ? ? ?<p style="color:#fff;text-align: center;">Copyright ? 2017.Firmenname Alle Rechte X-admin </p>
? ? ? ?{include file='public/base_js'/}
? ? ? ?<script>
? ? ? ? ? ?layui.use(['form'],
? ? ? ? ? ?function() {
? ? ? ? ? ? ? ?$ =layui.jquery;
? ? ? ? ? ? ? ?var form =.layui.form (),
? ? ? ? ? ? ? ?layer =layui.layer;
? ? ? ? ? ? ? ?$(' .x-login-right li').click(function(event) {
? ? ? ? ? ? ? ? ? ?color = $(this).attr('color');
? ? ? ? ? ? ? ? ? ?$('body').css('background-color', color) ;
? ? ? ? ? ? ? ?});
? ? ? ? ? ? ? ?//監(jiān)聽(tīng)提交
// ? ? ? ? ? ? ?form.on('submit(save)',
// ? ? ? ? ? ? ? ?function(data) {
// ? ? ? ? ? ? ? ? ? ?console.log(data);
// ? ? ? ? ? ? ? ? ? ?layer.alert( JSON.stringify(data.field), {
// ? ? ? ? ? ? ? ? ? ?title: '最終的提交信息'
// ? ? ? ? ? ? ? ? ?},function ?() {
// ? ? ? ? ? ? ? ? ?? ?location.href = "./index.html";
// ? ? ? ? ? ? ? ? ? ?})
// ? ? ? ? ? ? ? ? ? ?return false;
// ? ? ? ? ? ? ? ?});
? ? ? ? ?});
? ? ? ?</script>
? ? ? ?<script> ;
? ? ? ? ? ?$(function () {
? ? ? ? ? ? ? ?$("#loginbtn").on('click ',function () {
? ? ? ? ? ? ? ? ? ?$.ajax({
? ? ? ? ? ? ? ? ? ? ?type:'POST',
? ? ? ? ? ? ? ? ? ? ?url:"{:url('login/check')}",
.? ? ? ? ? ? ? ? ? ? ? ?data:$(".layui-form").serialize (),
? ? ? ? ? ? ? ? ? ? ? ?dataType:"json",
? ? ? ? ? ? ? ? ? ? ? ?success:function (data) {
? ? ? ? ? ? ? ? ? ? ? ? ?if (data.status == 1){
? ? ? ? ? ? ? ? ? ? ? ? ? ?warning(data.message);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?window.location.href = "{:url('index/index' )}";
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?alert(data.message);
? ? ? ? ? ? ? ? ? ? ?.location.href = "{:url('login/index')}";
? ? ? ? ? ? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ? ? ? ?? ? ?})
? ? ? ? ? ?})
? ? ? ?</script>
? ?</body>
</html>
lohin 控制器
<?php
namespace appadmincontroller;
use appadmincommonBase;
use thinkRequest;
use appadminmodelAdmin;
use thinkSession;
class Login erweitert Base
{
//Render login interface
public function index()
{
//
?????????????????????????????????????????????????????????????????????????????????????????????????Return $this - > view -> ;
? ? ? ? ? ? ? ? // Formularübermittlungsdaten abrufen und speichern
? ? ? ? ? ? $data = $request -> ; ? ? ? ? ? ? ? $password = ?md5($data['password']) ;
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? $? ? ? ? ? ? ? ? ? ? ? ? ? ? using using using?????????????????????????????????????????????????????????????????????????????? t; = $password) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? using ? using ? using ? using ? ? ? ? ? ? using ‐ ' s ‐ ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??ndern Sie die Rückgabeinformationen
$status = 1;
$message = 'Best?tigung bestanden, klicken Sie bitte auf OK, um den Hintergrund aufzurufen';
//Aktualisieren Sie die Anzahl der Anmeldungen und die letzte Anmeldezeit in der Tabelle
$admin -> setInc('login_count'); ? ? ? ? ? ? $admin -> time()] ;
??????????????????????????????????????????????????????????????????????????????????????????????????????? // Speichern Sie die Benutzeranmeldeinformationen in der Sitzung, damit andere Controller die Anmeldung beurteilen k?nnen
//????????????????????? Session::set('user_id' , $userName);
// Session::set('user_inf',$data );
Session::set('user_id', $userName);
Session::set('suer_inf', $data);
) sion::delete(' user_id');
Session::delete('user_inf');
$this -> success('Logout erfolgreich, Rückkehr....', 'login/index');
}
}
打開(kāi)調(diào)試模式提示