fastadmin前台会员中心权限控制设置noNeedRight不起作用
时间:2023年05月11日
/来源:网络
/编辑:佚名
【fastadmin】踩坑第一发-前台会员中心权限控制
刚刚脑子秀逗了 没转过弯 再次更新一下 上面那样修改 会导致设置noNeedRight不起作用
其实只需要修改applicationindexcontrollerUser.php
protected $noNeedRight = ['index'];
复制
这个的意思是 不需要权限控制 但是需要登陆的 你把控制器里面不需要控制权限但是需要登陆的方法写进去
protected $noNeedLogin = ['login', 'register', 'third'];
复制
这个是不需要登陆的方法
这样修改*就行了,写进去不需要权限控制的 但是需要登陆的 那么剩余的方法就是 需要登陆 并且还需要判断权限的

效果相同




刚刚脑子秀逗了 没转过弯 再次更新一下 上面那样修改 会导致设置noNeedRight不起作用
其实只需要修改applicationindexcontrollerUser.php
protected $noNeedRight = ['index'];
复制
这个的意思是 不需要权限控制 但是需要登陆的 你把控制器里面不需要控制权限但是需要登陆的方法写进去
protected $noNeedLogin = ['login', 'register', 'third'];
复制
这个是不需要登陆的方法
这样修改*就行了,写进去不需要权限控制的 但是需要登陆的 那么剩余的方法就是 需要登陆 并且还需要判断权限的

效果相同




新闻资讯 更多
- 【建站知识】查询nginx日志状态码大于400的请求并打印整行04-03
- 【建站知识】Python中的logger和handler到底是个什么?04-03
- 【建站知识】python3拉勾网爬虫之(您操作太频繁,请稍后访问)04-03
- 【建站知识】xpath 获取meta里的keywords及description的方法04-03
- 【建站知识】python向上取整以50为界04-03
- 【建站知识】scrapy xpath遇见乱码解决04-03
- 【建站知识】scrapy爬取后中文乱码,解决word转为html 时cp1252编码问题04-03
- 【建站知识】scrapy采集—爬取中文乱码,gb2312转为utf-804-03