修改 var/Widget/Login.php文件 最后几行就是判断登录成功跳转的
![图片[1]-Typecho二开之让用户登录后跳转到前台页面而不是进入后台-米克随笔](https://blog.mk4.cc/wp-content/uploads/2022/07/image-47.png)
可以根据自己业务场景修改,我的需求是关注者就是普通用户,普通用户登录就跳前台,管理登录跳后台
$user = $this->db->fetchRow($this->db->select()->from('table.users')
->where('name = ?', $this->request->name)
->limit(1));
if($user['group']=='subscriber'){
$this->response->redirect($this->options->index);//关注者
}elseif($user['group']=='administrator'){
$this->response->redirect($this->options->adminUrl);//管理
}else{
其他用户
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容