Blame view

app-api/controllers/BaseController.php 965 Bytes
cfe42223   曹明   提交初始代码
1
2
3
4
<?php

namespace app\api\controllers;

200040c1   xu   app-api
5
use Yii;
cfe42223   曹明   提交初始代码
6
7
8
use yii\rest\Controller as RestController;
use yii\filters\ContentNegotiator;
use yii\filters\RateLimiter;
cfe42223   曹明   提交初始代码
9
10
use yii\web\Response;
use yii\filters\VerbFilter;
200040c1   xu   app-api
11
use yii\base\Exception;
abb310b5   xu   删除冗余的代码
12
13
14
15
use function str_replace;
use function json_encode;
use function explode;

cfe42223   曹明   提交初始代码
16

cfe42223   曹明   提交初始代码
17
18
19
20
21
22
class BaseController extends RestController
{
    /** @var \yii\web\request **/
    public $request;
    /** @var \yii\web\response **/
    public $response;
abb310b5   xu   删除冗余的代码
23
    /** @var \yii\web\User **/
abb310b5   xu   删除冗余的代码
24

200040c1   xu   app-api
25
26
27
28
29
30
31
32
33

    /** @inheritdoc **/
    public function behaviors()
    {
        return [
            'contentNegotiator' => [
                'class' => ContentNegotiator::className(),
                'formats' => [
                    'application/json' => Response::FORMAT_JSON
cfe42223   曹明   提交初始代码
34
35
36
37
38
39
40
41
42
43
44
45
46
                ],
            ],
            'verbFilter' => [
                'class' => VerbFilter::className(),
                'actions' => $this->verbs(),
            ],

        ];
    }



}
cfe42223   曹明   提交初始代码

f10a8ca1   xu   1. F API 授权接口调整

cfe42223   曹明   提交初始代码

200040c1   xu   app-api

abb310b5   xu   删除冗余的代码

200040c1   xu   app-api

cfe42223   曹明   提交初始代码

cfe42223   曹明   提交初始代码