点击后台退出按钮,清空用户session,重定向到用户登录界面。
1、在文件 D:\wamp\www\wish\APP\Admin\Controller\IndexController.class.php 中新增 logout方法:
1
2
3
4
5
|
Public
function
logout(){
session_unset();
session_destroy();
$this
->redirect(
'Admin/Login/index'
);
}
|
2、修改后台页面退出按钮的连接 D:\wamp\www\wish\APP\Admin\View\Index_index.html:
1
|
<
a
href
=
"{:U('Admin/Index/logout')}"
target
=
"_self"
>退出</
a
>
|