New Login path
This commit is contained in:
@@ -63,7 +63,8 @@ $routes->post('/en/wrench/api/v1/createmobileuser', 'WrenchApi::apigate');
|
|||||||
$routes->post('/en/wrench/api/v1/completemobileuser', 'WrenchApi::apigate');
|
$routes->post('/en/wrench/api/v1/completemobileuser', 'WrenchApi::apigate');
|
||||||
$routes->post('/en/wrench/api/v1/startresetpasword', 'WrenchApi::apigate');
|
$routes->post('/en/wrench/api/v1/startresetpasword', 'WrenchApi::apigate');
|
||||||
|
|
||||||
$routes->post('/en/wrench/api/v1/userlogin', 'WrenchApi::apigate');
|
// $routes->post('/en/wrench/api/v1/userlogin', 'WrenchApi::apigate');
|
||||||
|
$routes->post('/en/wrench/api/v1/userlogin', 'WrenchAuth::userLogin'); // New routes defined
|
||||||
$routes->post('/en/wrench/api/v1/qrlogin', 'WrenchApi::apigate');
|
$routes->post('/en/wrench/api/v1/qrlogin', 'WrenchApi::apigate');
|
||||||
|
|
||||||
$routes->post('/en/wrench/api/v1/homebanners', 'WrenchApi::apigate');
|
$routes->post('/en/wrench/api/v1/homebanners', 'WrenchApi::apigate');
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
class WrenchAuth extends BaseController
|
||||||
|
{
|
||||||
|
public function userLogin(){
|
||||||
|
|
||||||
|
$in = $this->request->getPost();
|
||||||
|
$in["action"] = WRENCHBOARD_ACCOUNT_LOGIN;
|
||||||
|
if (!isset($in["login_mode"])){
|
||||||
|
$in["login_mode"] = MOBILE_LOGIN;
|
||||||
|
}
|
||||||
|
$endpoint = "USER_SESSION-";
|
||||||
|
$out=[];
|
||||||
|
// $out = $this->getCache($endpoint); // try find in cache
|
||||||
|
// if ( empty($out) || !is_array($out)){
|
||||||
|
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
|
||||||
|
$out['internal_return'] = $ret;
|
||||||
|
$this->saveCache($endpoint,$out,15000);
|
||||||
|
// }
|
||||||
|
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// WrenchAuth::userLogin
|
||||||
@@ -4,8 +4,6 @@ namespace App\Controllers;
|
|||||||
|
|
||||||
class WrenchGeneralData extends BaseController
|
class WrenchGeneralData extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -19,7 +17,7 @@ class WrenchGeneralData extends BaseController
|
|||||||
if ( empty($out) || !is_array($out)){
|
if ( empty($out) || !is_array($out)){
|
||||||
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
|
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
|
||||||
$out['internal_return'] = $ret;
|
$out['internal_return'] = $ret;
|
||||||
$this->saveCache($endpoint,$out,$timeLine=15000);
|
$this->saveCache($endpoint,$out,15000);
|
||||||
}
|
}
|
||||||
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
|
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user