mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
added 完成后台登录登出接口
This commit is contained in:
parent
62b03b81a9
commit
689c4a4624
@ -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);
|
||||
|
@ -6,6 +6,10 @@ return [
|
||||
'admin/Login/index',
|
||||
['method' => 'post']
|
||||
],
|
||||
'Login/logout' => [
|
||||
'admin/Login/logout',
|
||||
['method' => 'get']
|
||||
],
|
||||
'__miss__' => ['admin/Miss/index'],
|
||||
],
|
||||
];
|
||||
|
@ -187,7 +187,7 @@ return [
|
||||
|
||||
'cache' => [
|
||||
// 驱动方式
|
||||
'type' => 'File',
|
||||
'type' => 'Redis',
|
||||
// 缓存保存目录
|
||||
'path' => CACHE_PATH,
|
||||
// 缓存前缀
|
||||
|
Loading…
x
Reference in New Issue
Block a user