Commit 32fd74da authored by shajiaiming's avatar shajiaiming

fix

parent 8db078cd
......@@ -24,13 +24,14 @@ class UserController extends BaseController
$model = new LoginForm();
$model->setScenario(LoginForm::SCENARIOS_LOGIN);
$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
$data = null;
$code = -1;
goto doEnd;
}
$data = ['access_token' => $model->login()];
$data = ['access_token' => $access_token];
doEnd :
return ['code' => $code, 'msg' => $msg, 'data' => $data];
......@@ -127,17 +128,17 @@ class UserController extends BaseController
public function actionUserList()
{
$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 = empty($platform_id) ? 1 : $platform_id;
} else {
$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' => '此钱包节点尚未开通'];
}
$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);
$size = Yii::$app->request->get('size', 15);
......@@ -177,22 +178,22 @@ class UserController extends BaseController
}
/**
* 人工实名全部列表
* 人工实名全部列表
*/
public function actionManualList()
{
$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 = empty($platform_id) ? 1 : $platform_id;
} else {
$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' => '此钱包节点尚未开通'];
}
$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);
$size = Yii::$app->request->get('size', 15);
......@@ -232,22 +233,22 @@ class UserController extends BaseController
public function actionVerify()
{
$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 = empty($platform_id) ? 1 : $platform_id;
} else {
$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' => '此钱包节点尚未开通'];
}
$node_params = Yii::$app->params['trusteeship']['node_'. $platform_id];
$node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$post = Yii::$app->request->post();
$uid = isset($post['uid']) ? $post['uid'] : null;
$action = isset($post['action']) ? $post['action'] : null;
if(false == $uid || false == $action){
if (false == $uid || false == $action) {
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