萌新小白的记录贴。 1.application目录下api接口目录新建behavior模块,模块下创建CORS控制器 <?php namespace app\api\behavior; class CORS { public function appInit(&$params) { header