diff --git a/community_server/config/routes.php b/community_server/config/routes.php index f92b66b8b..5a537b9c2 100644 --- a/community_server/config/routes.php +++ b/community_server/config/routes.php @@ -110,6 +110,7 @@ Router::scope('/', function (RouteBuilder $routes) { */ //$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']); $routes->connect('/', ['controller' => 'Dashboard', 'action' => 'index']); + $routes->connect('/api/:action/*', ['controller' => 'AppRequests'], ['routeClass' => 'DashedRoute']); //$routes->connect('/client', ['controller' => 'Pages', 'action' => 'display', 'js']); $routes->connect('/server', ['controller' => 'Dashboard', 'action' => 'serverIndex']); $routes->connect('/client', ['controller' => 'Pages', 'action' => 'display', 'vue']); diff --git a/community_server/src/Controller/AppRequestsController.php b/community_server/src/Controller/AppRequestsController.php index fa59887c8..1608fce8a 100644 --- a/community_server/src/Controller/AppRequestsController.php +++ b/community_server/src/Controller/AppRequestsController.php @@ -72,6 +72,9 @@ class AppRequestsController extends AppController "group": "gdd1", "auto_sign": true */ + if(!$this->request->is('post')) { + return $this->returnJson(['state' => 'error', 'msg' => 'no post']); + } $data = $this->request->input('json_decode'); $login_request_result = $this->requestLogin(0, false); if($login_request_result !== true) { diff --git a/frontend/.env.dist b/frontend/.env.dist index c8323c316..c45d280c4 100644 --- a/frontend/.env.dist +++ b/frontend/.env.dist @@ -1,4 +1,5 @@ LOGIN_API_URL=http://localhost/login_api/ COMMUNITY_API_STATE_BALANCE_URL=http://localhost/state-balances/ COMMUNITY_API_TRANSACTION_CREATION_URL=http://localhost/transaction-creations/ +COMMUNITY_API_TRANSACTION_SEND_COINS=http://localhost/api VUE_PATH=/vue \ No newline at end of file diff --git a/frontend/src/apis/communityAPI.js b/frontend/src/apis/communityAPI.js index 54eb37df3..e1d148e2f 100644 --- a/frontend/src/apis/communityAPI.js +++ b/frontend/src/apis/communityAPI.js @@ -57,7 +57,7 @@ const communityAPI = { memo, auto_sign: true, } - return apiPost(CONFIG.COMMUNITY_API_TRANSACTION_SEND_COINS + 'ajaxCreate/', payload) + return apiPost(CONFIG.COMMUNITY_API_TRANSACTION_SEND_COINS + 'sendCoins/', payload) }, } diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index 334086c38..259eba695 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -16,7 +16,7 @@ const server = { // Schöpfung // COMMUNITY_API_TRANSACTION_CREATION_URL: process.env.COMMUNITY_API_TRANSACTION_CREATION_URL || 'http://localhost/transaction-creations/', COMMUNITY_API_TRANSACTION_SEND_COINS: - process.env.COMMUNITY_API_TRANSACTION_SEND_COINS || 'http://localhost/transaction-send-coins/', + process.env.COMMUNITY_API_TRANSACTION_SEND_COINS || 'http://localhost/api/', } const CONFIG = {