Commit 04e9ac0f authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into 'master'

fix See merge request !356
parents 8db078cd 32fd74da
...@@ -24,13 +24,14 @@ class UserController extends BaseController ...@@ -24,13 +24,14 @@ class UserController extends BaseController
$model = new LoginForm(); $model = new LoginForm();
$model->setScenario(LoginForm::SCENARIOS_LOGIN); $model->setScenario(LoginForm::SCENARIOS_LOGIN);
$model->load(Yii::$app->request->post(), ''); $model->load(Yii::$app->request->post(), '');
if (!$model->login()) {
if (!$access_token = $model->login()) {
$msg = implode(", ", \yii\helpers\ArrayHelper::getColumn($model->errors, 0, false)); // Model's Errors string $msg = implode(", ", \yii\helpers\ArrayHelper::getColumn($model->errors, 0, false)); // Model's Errors string
$data = null; $data = null;
$code = -1; $code = -1;
goto doEnd; goto doEnd;
} }
$data = ['access_token' => $model->login()]; $data = ['access_token' => $access_token];
doEnd : doEnd :
return ['code' => $code, 'msg' => $msg, 'data' => $data]; return ['code' => $code, 'msg' => $msg, 'data' => $data];
...@@ -127,17 +128,17 @@ class UserController extends BaseController ...@@ -127,17 +128,17 @@ class UserController extends BaseController
public function actionUserList() public function actionUserList()
{ {
$current_platform_id = Yii::$app->request->getPlatformId(); $current_platform_id = Yii::$app->request->getPlatformId();
if(1 === $current_platform_id) { if (1 === $current_platform_id) {
$platform_id = Yii::$app->request->get('platform_id', 1); $platform_id = Yii::$app->request->get('platform_id', 1);
$platform_id = empty($platform_id) ? 1 : $platform_id; $platform_id = empty($platform_id) ? 1 : $platform_id;
} else { } else {
$platform_id = Yii::$app->request->getPlatformId(); $platform_id = Yii::$app->request->getPlatformId();
} }
if(!isset(Yii::$app->params['trusteeship']['node_'. $platform_id])){ if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通']; return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通'];
} }
$node_params = Yii::$app->params['trusteeship']['node_'. $platform_id]; $node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$page = Yii::$app->request->get('page', 1); $page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 15); $size = Yii::$app->request->get('size', 15);
...@@ -177,22 +178,22 @@ class UserController extends BaseController ...@@ -177,22 +178,22 @@ class UserController extends BaseController
} }
/** /**
* 人工实名全部列表 * 人工实名全部列表
*/ */
public function actionManualList() public function actionManualList()
{ {
$current_platform_id = Yii::$app->request->getPlatformId(); $current_platform_id = Yii::$app->request->getPlatformId();
if(1 === $current_platform_id) { if (1 === $current_platform_id) {
$platform_id = Yii::$app->request->get('platform_id', 1); $platform_id = Yii::$app->request->get('platform_id', 1);
$platform_id = empty($platform_id) ? 1 : $platform_id; $platform_id = empty($platform_id) ? 1 : $platform_id;
} else { } else {
$platform_id = Yii::$app->request->getPlatformId(); $platform_id = Yii::$app->request->getPlatformId();
} }
if(!isset(Yii::$app->params['trusteeship']['node_'. $platform_id])){ if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通']; return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通'];
} }
$node_params = Yii::$app->params['trusteeship']['node_'. $platform_id]; $node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$page = Yii::$app->request->get('page', 1); $page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 15); $size = Yii::$app->request->get('size', 15);
...@@ -232,22 +233,22 @@ class UserController extends BaseController ...@@ -232,22 +233,22 @@ class UserController extends BaseController
public function actionVerify() public function actionVerify()
{ {
$current_platform_id = Yii::$app->request->getPlatformId(); $current_platform_id = Yii::$app->request->getPlatformId();
if(1 === $current_platform_id) { if (1 === $current_platform_id) {
$platform_id = Yii::$app->request->get('platform_id', 1); $platform_id = Yii::$app->request->get('platform_id', 1);
$platform_id = empty($platform_id) ? 1 : $platform_id; $platform_id = empty($platform_id) ? 1 : $platform_id;
} else { } else {
$platform_id = Yii::$app->request->getPlatformId(); $platform_id = Yii::$app->request->getPlatformId();
} }
if(!isset(Yii::$app->params['trusteeship']['node_'. $platform_id])){ if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通']; return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通'];
} }
$node_params = Yii::$app->params['trusteeship']['node_'. $platform_id]; $node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$post = Yii::$app->request->post(); $post = Yii::$app->request->post();
$uid = isset($post['uid']) ? $post['uid'] : null; $uid = isset($post['uid']) ? $post['uid'] : null;
$action = isset($post['action']) ? $post['action'] : null; $action = isset($post['action']) ? $post['action'] : null;
if(false == $uid || false == $action){ if (false == $uid || false == $action) {
return ['code' => -1, 'data' => [], 'msg' => '参数错误']; return ['code' => -1, 'data' => [], 'msg' => '参数错误'];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment