/*
** @author water
** @admin 跨域问题
** @2018-10-10
**
*/
public function _initialize(){
$this->cross();
}
public function cross(){
header('Content-Type:application/json; charset=utf-8');
header('Access-Control-Allow-Origin:前端域名地址');
//header('Access-Control-Max-Age:86400');
header('Access-Control-Allow-Methods:OPTIONS,POST,PUT,DELETE');
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。