Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 259 forks source link

这个地方的路由怎么实现的 #64

Closed talkcenter closed 6 years ago

talkcenter commented 6 years ago

qq 20180113131959

billge1205 commented 6 years ago

这里只是根据登陆态跳转到/login 逻辑在previlegeService 的login_require里

talkcenter commented 6 years ago

比如我创建Home的控制器怎样配置Home的路由呢?

billge1205 commented 6 years ago

默认规则的路由不用配置 /Home => HomeAction 中的 action_index /Home/method => HomeAction 中的 action_method

talkcenter commented 6 years ago

我按照这http://www.billge.cc/demo/#router-rule里去做不能实现呀?

billge1205 commented 6 years ago

发一下你的目录结构和请求的url 另外nginx是否配置正确 还有路由是需要大小写全匹配的

billge1205 commented 6 years ago

还有看下返回什么错误 如果是nginx报错 那可能跟nginx配置有关 参考http://www.billge.cc/#overview-index 如果是php报错 麻烦发一下错误信息

talkcenter commented 6 years ago

我重新配置了一下出现500的报错

billge1205 commented 6 years ago

错误信息发下

talkcenter commented 6 years ago

解决了,从头到尾都是我的Apache 配置不对

billge1205 commented 6 years ago

好的 有问题和建议欢迎随时交流

talkcenter commented 6 years ago

还有个小问题,logs目录里面我全部清空了,访问一次首页又会出现一个错误的日志文件是什么情况,还是我的配置有问题吗?

billge1205 commented 6 years ago

日志文件是默认一直会记录的 包括请求的信息以及错误的信息(默认会记录Notice级别以上的错误) /config/config.php中errorLevel 可以配置错误级别

talkcenter commented 6 years ago

正常应该是一个log_2018-01-13.log qq 20180113184411

billge1205 commented 6 years ago

你可以打开看下有些什么错误 输出级别可以在config.php中控制

talkcenter commented 6 years ago

这是什么错误? qq 20180113192132

billge1205 commented 6 years ago

这错误就是 (你的域名)/robots.txt 这个url 404了 可能是你页面或者apache请求的 你可以在 /web/目录下放一个robots.txt 让它能被请求到