-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
# aycors | ||
thinkphp5 for cors | ||
|
||
## 安装方法 | ||
|
||
### 第一步 使用composer下载SDK | ||
|
||
```bash | ||
composer require ayteam/aycors | ||
``` | ||
|
||
### 第二步 项目根目录执行 | ||
|
||
```bash | ||
php think cors:config | ||
``` | ||
|
||
> 查看application/extra/cors.php这个文件是否存在, | ||
如果不存在复制一份 [config.php](https://github.com/ayteam/aycors/blob/master/src/config.php) | ||
到 application/extra | ||
|
||
## 使用方法 | ||
具体参考 [跨域资源共享 CORS 详解](http://www.ruanyifeng.com/blog/2016/04/cors.html) | ||
|
||
```php | ||
return Cors::json(['code'=>1]); | ||
``` | ||
如果有不懂的,可以下面评论。 | ||
也欢迎大家在github提交issue和PR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters