Commit 9f61329b authored by hujun's avatar hujun

检测登录

parent d574ecac
...@@ -9,6 +9,7 @@ use app\model\AAgents; ...@@ -9,6 +9,7 @@ use app\model\AAgents;
use app\model\AStore; use app\model\AStore;
use app\model\AuthGroup; use app\model\AuthGroup;
use app\model\AuthRule; use app\model\AuthRule;
use phpDocumentor\Reflection\DocBlock\Tags\See;
use think\Session; use think\Session;
/** /**
...@@ -152,4 +153,20 @@ class Login extends Basic ...@@ -152,4 +153,20 @@ class Login extends Basic
Session::clear(); Session::clear();
return view("/login/login", [ "msg" => "退出成功" ]); return view("/login/login", [ "msg" => "退出成功" ]);
} }
/**
* 检测登录
*
* @return \think\Response
*/
public function checkLogin() {
Session::clear();
$user_id = Session::get("userId");
if (empty($user_id)) {
return $this->response(300, '请重新登录');
} else {
return $this->response(200, '');
}
}
} }
\ No newline at end of file
...@@ -90,6 +90,7 @@ Route::group('index', [ ...@@ -90,6 +90,7 @@ Route::group('index', [
'login' => [ 'index/login/login', [ 'method' => 'get' ] ], 'login' => [ 'index/login/login', [ 'method' => 'get' ] ],
'loginVerify' => [ 'index/login/loginVerify', [ 'method' => 'post|get' ] ], 'loginVerify' => [ 'index/login/loginVerify', [ 'method' => 'post|get' ] ],
'logout' => [ 'index/login/logout', [ 'method' => 'get' ] ], //退出 'logout' => [ 'index/login/logout', [ 'method' => 'get' ] ], //退出
'checkLogin' => [ 'index/login/checkLogin', [ 'method' => 'get' ] ], //退出
//watchshop 预约看铺 //watchshop 预约看铺
'watch_shop/:check_status' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], [ 'check_status' => 1 ] ], 'watch_shop/:check_status' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], [ 'check_status' => 1 ] ],
'our_watch_shop/:check_status' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], [ 'check_status' => 2 ] ], 'our_watch_shop/:check_status' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], [ 'check_status' => 2 ] ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment