diff --git a/composer.json b/composer.json index 99a5b6a..3409304 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,8 @@ "illuminate/redis": "^10.48", "symfony/var-dumper": "^6.4", "webman/think-orm": "^1.1", - "phpoffice/phpspreadsheet": "^3.6" + "phpoffice/phpspreadsheet": "^3.6", + "webman/cors": "^1.0" }, "suggest": { "ext-event": "For better performance. " diff --git a/composer.lock b/composer.lock index 8d7b20d..4631e43 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "69fc720415852f55d5319c4ab078fb79", + "content-hash": "2c1b8b0e9c047637f20d3f84ec8deb36", "packages": [ { "name": "brick/math", @@ -3955,6 +3955,36 @@ }, "time": "2022-08-18T12:14:59+00:00" }, + { + "name": "webman/cors", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/webman-php/cors.git", + "reference": "a5396634fd2ee4e7b15abba0bab45f28e1c1ad02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webman-php/cors/zipball/a5396634fd2ee4e7b15abba0bab45f28e1c1ad02", + "reference": "a5396634fd2ee4e7b15abba0bab45f28e1c1ad02", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webman\\Cors\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "support": { + "issues": "https://github.com/webman-php/cors/issues", + "source": "https://github.com/webman-php/cors/tree/v1.0.1" + }, + "time": "2022-11-05T11:16:20+00:00" + }, { "name": "webman/event", "version": "v1.0.5", diff --git a/config/plugin/webman/cors/app.php b/config/plugin/webman/cors/app.php new file mode 100644 index 0000000..8f9c426 --- /dev/null +++ b/config/plugin/webman/cors/app.php @@ -0,0 +1,4 @@ + true, +]; \ No newline at end of file diff --git a/config/plugin/webman/cors/middleware.php b/config/plugin/webman/cors/middleware.php new file mode 100644 index 0000000..67b99b4 --- /dev/null +++ b/config/plugin/webman/cors/middleware.php @@ -0,0 +1,19 @@ + + * @copyright walkor + * @link http://www.workerman.net/ + * @license http://www.opensource.org/licenses/mit-license.php MIT License + */ + +return [ + '' => [ + \Webman\Cors\CORS::class + ] +]; \ No newline at end of file