wip
This commit is contained in:
@@ -19,14 +19,14 @@ class Login extends BaseController
|
||||
|
||||
// 验证数据
|
||||
if (empty($params['username']) || empty($params['password'])) {
|
||||
return $this->error(400, '用户名和密码不能为空');
|
||||
return $this->error('用户名和密码不能为空');
|
||||
}
|
||||
|
||||
try {
|
||||
$result = $authService->login($params['username'], $params['password']);
|
||||
return $this->success(200, '登录成功', $result);
|
||||
return $this->success('登录成功', $result);
|
||||
} catch (\Exception $e) {
|
||||
return $this->error(400, $e->getMessage());
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,6 @@ class Login extends BaseController
|
||||
public function logout()
|
||||
{
|
||||
Session::clear();
|
||||
return $this->success(200, '退出成功');
|
||||
return $this->success('退出成功');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user