代码更新

This commit is contained in:
2019-07-01 16:13:59 +08:00
parent d141eb7c24
commit 86c24dc40e
30 changed files with 13731 additions and 94 deletions

View File

@@ -31,11 +31,31 @@ class Index extends Admin{
/**
* @title 后台登录
*/
public function login(){
public function login(\app\model\Member $member){
if ($this->request->isAjax()) {
Session::set('user', ['uid'=>1,'username'=>'admin']);
$username = $this->request->param('username', '');
$password = $this->request->param('password', '');
$user = $member->login($username, $password);
if ($user) {
Session::set('user', $user);
$this->data['url'] = "/admin/index/index.html";
$this->data['msg'] = "登录成功!";
}else{
Session::set('user', null);
$this->data['code'] = 1;
$this->data['msg'] = "登录失败!";
}
return $this->data;
}
}
/**
* @title 后台登出
*/
public function logout(){
Session::set('user', null);
$this->data['code'] = 0;
return $this->data;
}
}