File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
application/api/controller Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ class Api
1919
2020 protected $ clientInfo ;
2121
22+ /**
23+ * 不需要鉴权方法
24+ */
25+ protected $ noAuth = [];
26+
2227 /**
2328 * 构造方法
2429 * @param Request $request Request对象
Original file line number Diff line number Diff line change 77use app \api \controller \Api ;
88
99class User extends Api
10- {
10+ {
11+ /**
12+ * 不需要鉴权方法
13+ * * 表示全部不需要授权
14+ * ['index','save']
15+ */
16+ protected $ noAuth = [];
17+
1118 /**
1219 * 显示资源列表
1320 *
Original file line number Diff line number Diff line change 142142 'show_error_msg ' => false ,
143143 // 异常处理handle类 留空使用 \think\exception\Handle
144144 'exception_handle ' => '\\app \\api \\exception \\ExceptionHandler ' ,
145- //某些方法不需要使用接口鉴权,一些公共类方法
146- 'allow_method ' =>[
147- 'V1.User/index/get ' , //post方法允许直接访问
148- ]
149-
150145];
You can’t perform that action at this time.
0 commit comments