tp5前置方法不起作用问题

原来是 'only' = 'createorupdateaddress' 里的属性方法名只能全部小写的缘故,

第一种方法是驼峰式命名所以识别不了,最后改成了小写就好了

 第二种方法修改think\Controller中beforeAction方法,

把 所有 $this->request->action()改成$this->request->action(true),就可以支持驼峰式命名

 

posted @ 2020-09-20 17:05  至疾  阅读(332)  评论(1)    收藏  举报