|
@@ -9,9 +9,9 @@ class Login extends Controller{
|
|
/**
|
|
/**
|
|
* 管理员登录
|
|
* 管理员登录
|
|
* */
|
|
* */
|
|
- public function Login(){
|
|
|
|
- $username = input('post.username');
|
|
|
|
- $password = input('post.password');
|
|
|
|
|
|
+ public function Login() {
|
|
|
|
+ $username = input('get.username');
|
|
|
|
+ $password = input('get.password');
|
|
|
|
|
|
$UserModel = new UserModel();
|
|
$UserModel = new UserModel();
|
|
$hasUser = $UserModel->checkUser($username);
|
|
$hasUser = $UserModel->checkUser($username);
|
|
@@ -41,14 +41,14 @@ class Login extends Controller{
|
|
session('username', $hasUser['user_name']);
|
|
session('username', $hasUser['user_name']);
|
|
session('id', $hasUser['id']);
|
|
session('id', $hasUser['id']);
|
|
|
|
|
|
- json_return(200,[],'success');
|
|
|
|
|
|
+ json_success([]);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 管理员退出
|
|
* 管理员退出
|
|
*/
|
|
*/
|
|
- public function LoginOut(){
|
|
|
|
|
|
+ public function LoginOut() {
|
|
session('username', null);
|
|
session('username', null);
|
|
session('id', null);
|
|
session('id', null);
|
|
- json_return(200,[],'success');
|
|
|
|
|
|
+ json_success([]);
|
|
}
|
|
}
|
|
}
|
|
}
|