提一个在 dingapi 路由中使用 middleware 的新手问题~
运行正确的定义:
$api->get('cache', ['middleware' => ['api.throttle',], 'limit' => 20, 'expires' => 1 ,function () {
return 'ok'
}]);
因为我的function是某个类中的某个方法,于是将上面的定义改成下面样:$api->get('cache', ['middleware' => ['api.throttle',], 'limit' => 20, 'expires' => 1 ,'CacheController@test']);
然后就出错了~
所以我想知道正确的方式,但我真的没有google到...
推荐文章: