归档
This commit is contained in:
19
app/user/loginsubmit.php
Normal file
19
app/user/loginsubmit.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if(empty($_POST))sysmsg('POST来的数据不能为空');
|
||||
if(empty($_POST['username']))sysmsg('用户名不能为空');
|
||||
if(empty($_POST['password']))sysmsg('密码不能为空');
|
||||
|
||||
$aes=new lib\Aes();
|
||||
$username=$_POST['username'];
|
||||
$password=$aes->encrypt($_POST['password']);
|
||||
|
||||
$login=new user\account();
|
||||
$userinfo=$login->login($username,$password);
|
||||
if($userinfo['uid']<0){//登录失败
|
||||
alert($userinfo['msg']);
|
||||
}else{
|
||||
if ($userinfo['adminer']==1)$cookie::set('admin',$userinfo['uid']."@admin.com",null,'/');
|
||||
$cookie::set('uid',$userinfo['uid'],null,'/');
|
||||
alert('登录成功');
|
||||
}
|
||||
go('-1');
|
||||
Reference in New Issue
Block a user