Skip to content

ayteam/aycors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aycors

thinkphp5 for cors

安装方法

第一步 使用composer下载SDK

composer require ayteam/aycors

第二步 项目根目录执行

php think cors:config

查看application/extra/cors.php这个文件是否存在, 如果不存在复制一份 config.php 到 application/extra

使用方法

参考阅读 跨域资源共享 CORS 详解

return Cors::json(['code'=>1]); // 替代 return json(['code'=>1]);