added 完成后台登录登出接口

This commit is contained in:
zhaoxiang 2018-01-15 19:28:09 +08:00
parent 62b03b81a9
commit 689c4a4624
3 changed files with 10 additions and 2 deletions

View File

@ -60,7 +60,11 @@ class Login extends Base {
return $this->buildSuccess($return, '登录成功');
}
public function logout($userToken) {
public function logout() {
$userToken = $this->request->get('userToken');
if (!$userToken) {
return $this->buildFailed(ReturnCode::NOT_EXISTS, '缺少userToken!');
}
$userInfo = cache($userToken);
$userInfo = json_decode($userInfo, true);
cache($userToken, null);

View File

@ -6,6 +6,10 @@ return [
'admin/Login/index',
['method' => 'post']
],
'Login/logout' => [
'admin/Login/logout',
['method' => 'get']
],
'__miss__' => ['admin/Miss/index'],
],
];

View File

@ -187,7 +187,7 @@ return [
'cache' => [
// 驱动方式
'type' => 'File',
'type' => 'Redis',
// 缓存保存目录
'path' => CACHE_PATH,
// 缓存前缀