// +---------------------------------------------------------------------- namespace app\index\controller; use app\index\service\PRedis; use cmf\controller\HomeBaseController; class LoginController extends HomeBaseController { public function index() { return $this->fetch(); } /** * 退出登录 */ public function logout(){ $cacheKey = md5(session('UID').'qxq'); PRedis::del($cacheKey); session('UID', 0); $this->redirect(url('/index/login/index')); } public function test(){ return $this->fetch(); } }