12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- class Demo extends Api
- {
-
-
-
-
-
- protected $noNeedLogin = ['test', 'test1'];
-
- protected $noNeedRight = ['test2'];
-
- public function test()
- {
- $data = [
- [
- 'type' => 'video',
- 'url' => '/upload/20240712/aaaaa.mp4',
- ],
- [
- 'type' => 'img',
- 'url' => '/upload/20240712/bbbbb.jpg',
- ],
- [
- 'type' => 'video',
- 'url' => '/upload/20240712/ccccc.mp4',
- ],
- [
- 'type' => 'img',
- 'url' => '/upload/20240712/ddddd.png',
- ],
- ];
- echo json_encode($data);
- }
-
- public function test1()
- {
- $rule = '246,230,240,259,260,317,253,261,262,263,100,265,102,103,104,120,267,269,270,110,266,113,114,289,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,271,272,274,290,280,281,282,283,284,286,273,278,279,275,276,277,291,292,293';
- $rule = explode(',',$rule);
- dump($rule);
- $b = array_count_values($rule);
- dump($b);
- }
-
- public function test2()
- {
- $this->success('返回成功', ['action' => 'test2']);
- }
-
- public function test3()
- {
- $this->success('返回成功', ['action' => 'test3']);
- }
- }
|