Commit 8d2071ca authored by shajiaiming's avatar shajiaiming

调整

parent f5bde594
...@@ -69,7 +69,8 @@ class ResponseMsg ...@@ -69,7 +69,8 @@ class ResponseMsg
} }
$view = [ $view = [
BaseConstant::CODE => $code, BaseConstant::CODE => $code,
BaseConstant::MESSAGE => $msg, BaseConstant::MSG => $msg,
BaseConstant::DATA => null,
]; ];
$json = json_encode($view); $json = json_encode($view);
return $this->dumpJsonData($json); return $this->dumpJsonData($json);
......
...@@ -25,14 +25,14 @@ class LoginStatusAuthInterceptor extends ActionFilter ...@@ -25,14 +25,14 @@ class LoginStatusAuthInterceptor extends ActionFilter
} }
$token_string = Yii::$app->request->headers->get('Token'); $token_string = Yii::$app->request->headers->get('Token');
if(false == $token_string){ if(false == $token_string){
$message = 'platform auth error'; $msg = 'platform auth error';
$code = '40004'; $code = '40004';
goto doEnd; goto doEnd;
} }
$model = new Admin(); $model = new Admin();
$user = $model->loginByAccessToken($token_string,''); $user = $model->loginByAccessToken($token_string,'');
if(false == $user){ if(false == $user){
$message = 'user auth error'; $msg = 'user auth error';
$code = '40004'; $code = '40004';
goto doEnd; goto doEnd;
} }
...@@ -42,7 +42,7 @@ class LoginStatusAuthInterceptor extends ActionFilter ...@@ -42,7 +42,7 @@ class LoginStatusAuthInterceptor extends ActionFilter
doEnd : doEnd :
// 返回错误 // 返回错误
$response_message = new ResponseMsg(); $response_message = new ResponseMsg();
$content = $response_message->jsonError($message, $code); $content = $response_message->jsonError($msg, $code);
$content = $response_message->withHeaders($response_message->getHeaders())->withContent($content); $content = $response_message->withHeaders($response_message->getHeaders())->withContent($content);
Yii::$app->response->data = $content; Yii::$app->response->data = $content;
Yii::$app->response->send(); Yii::$app->response->send();
......
...@@ -36,13 +36,13 @@ class UserAuthInterceptor extends ActionFilter ...@@ -36,13 +36,13 @@ class UserAuthInterceptor extends ActionFilter
$user_auth_map = $user_auth[$platform_id] ?? null; $user_auth_map = $user_auth[$platform_id] ?? null;
if(empty($user_auth_map)){ if(empty($user_auth_map)){
$code = '40001'; $code = '40001';
$message = 'platform auth error'; $msg = 'platform auth error';
goto doEnd; goto doEnd;
} }
$user_auth_map = $user_auth_map[$user_id] ?? null; $user_auth_map = $user_auth_map[$user_id] ?? null;
if(empty($user_auth_map)){ if(empty($user_auth_map)){
$code = '40001'; $code = '40001';
$message = 'user auth error'; $msg = 'user auth error';
goto doEnd; goto doEnd;
} }
$auth_type_map = Yii::$app->params['user_auth'][$user_auth_map]; $auth_type_map = Yii::$app->params['user_auth'][$user_auth_map];
...@@ -59,7 +59,7 @@ class UserAuthInterceptor extends ActionFilter ...@@ -59,7 +59,7 @@ class UserAuthInterceptor extends ActionFilter
} }
if(false == $switch){ if(false == $switch){
$code = '40003'; $code = '40003';
$message = 'controller auth error'; $msg = 'controller auth error';
goto doEnd; goto doEnd;
} }
if(empty($action_map)){ if(empty($action_map)){
...@@ -69,14 +69,14 @@ class UserAuthInterceptor extends ActionFilter ...@@ -69,14 +69,14 @@ class UserAuthInterceptor extends ActionFilter
return true; return true;
}else{ }else{
$code = '40004'; $code = '40004';
$message = 'action auth error'; $msg = 'action auth error';
goto doEnd; goto doEnd;
} }
doEnd : doEnd :
// 返回错误 // 返回错误
$response_message = new ResponseMsg(); $response_message = new ResponseMsg();
$content = $response_message->jsonError($message, $code); $content = $response_message->jsonError($msg, $code);
$content = $response_message->withHeaders($response_message->getHeaders())->withContent($content); $content = $response_message->withHeaders($response_message->getHeaders())->withContent($content);
Yii::$app->response->data = $content; Yii::$app->response->data = $content;
Yii::$app->response->send(); Yii::$app->response->send();
......
...@@ -36,7 +36,10 @@ class MonitorController extends BaseController ...@@ -36,7 +36,10 @@ class MonitorController extends BaseController
foreach ($models as $model){ foreach ($models as $model){
$address[] = $model['address']; $address[] = $model['address'];
} }
if(empty($address)){
$data = null;
goto doEnd;
}
$service = new Chain33Service(); $service = new Chain33Service();
$execer = 'coins'; $execer = 'coins';
$result = $service->getBalance($address, $execer); $result = $service->getBalance($address, $execer);
...@@ -57,7 +60,7 @@ class MonitorController extends BaseController ...@@ -57,7 +60,7 @@ class MonitorController extends BaseController
'list' => $models, 'list' => $models,
'page' => [ 'page' => [
'pageCount' => $pages->pageCount, 'pageCount' => $pages->pageCount,
'pageSize' => 20, 'pageSize' => 10,
'currentPage' => $page, 'currentPage' => $page,
] ]
]; ];
......
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