Commit 8d2071ca authored by shajiaiming's avatar shajiaiming

调整

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