fix cors
This commit is contained in:
parent
ea7c781d06
commit
b24125ac66
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use yii\db\Migration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles dropping columns from table `{{%manager}}`.
|
||||||
|
*/
|
||||||
|
class m230419_100612_drop_user_card_id_column_from_manager_table extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function safeUp()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function safeDown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -26,7 +26,7 @@ use yii\web\Response;
|
|||||||
* ),
|
* ),
|
||||||
*
|
*
|
||||||
* @OA\Server(
|
* @OA\Server(
|
||||||
* url="https://guild.loc/api",
|
* url="http://guild.loc/api",
|
||||||
* description="Локальный сервер",
|
* description="Локальный сервер",
|
||||||
* ),
|
* ),
|
||||||
*
|
*
|
||||||
@ -49,6 +49,7 @@ class ApiController extends Controller
|
|||||||
'class' => GsCors::class,
|
'class' => GsCors::class,
|
||||||
'cors' => [
|
'cors' => [
|
||||||
'Origin' => ['*'],
|
'Origin' => ['*'],
|
||||||
|
'Access-Control-Request-Methods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'],
|
||||||
//'Access-Control-Allow-Credentials' => true,
|
//'Access-Control-Allow-Credentials' => true,
|
||||||
'Access-Control-Allow-Headers' => [
|
'Access-Control-Allow-Headers' => [
|
||||||
'Access-Control-Allow-Origin',
|
'Access-Control-Allow-Origin',
|
||||||
|
@ -330,8 +330,7 @@ class RequestController extends ApiController
|
|||||||
|
|
||||||
$put = array_diff(\Yii::$app->request->getBodyParams(), [null, '']);
|
$put = array_diff(\Yii::$app->request->getBodyParams(), [null, '']);
|
||||||
|
|
||||||
$requestService->load($put, '')
|
$requestService->load($put, '')->save();
|
||||||
->save();
|
|
||||||
|
|
||||||
if (!$requestService->isSave) {
|
if (!$requestService->isSave) {
|
||||||
throw new BadRequestHttpException(json_encode($requestService->errors));
|
throw new BadRequestHttpException(json_encode($requestService->errors));
|
||||||
|
Loading…
Reference in New Issue
Block a user