Commit 0c8283fa authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/ucenter' into 'master'

Feature/ucenter See merge request !208
parents dce20133 698f7366
......@@ -38,7 +38,12 @@ class TrusteeShipService
}
if (!empty($params)) {
$ch->setGetParams($params);
if ('GET' == strtoupper($method)) {
$ch->setGetParams($params);
}
if ('POST' == strtoupper($method)) {
$ch->setPostParams($params);
}
}
$result = $ch->$method($this->urlBuild($uri), false);
......@@ -73,5 +78,31 @@ class TrusteeShipService
return $this->send("GET", $uri, $params);
}
public function getManualList($params = [])
{
$uri = 'backend/user/manual-real-list';
return $this->send("GET", $uri, $params);
}
public function verifyReal($params = [])
{
$uri = 'backend/user/verify-real';
return $this->send("POST", $uri, $params);
}
public function refuseReal($params = [])
{
$uri = 'backend/user/refuse-real';
return $this->send("POST", $uri, $params);
}
public function revokeReal($params = [])
{
$uri = 'backend/user/revoke-real';
return $this->send("POST", $uri, $params);
}
}
......@@ -175,4 +175,111 @@ class UserController extends BaseController
return ['code' => 1, 'data' => $result['msg'], 'msg' => 'success'];
}
/**
* 人工实名全部列表
*/
public function actionManualList()
{
$current_platform_id = Yii::$app->request->getPlatformId();
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])){
return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通'];
}
$node_params = Yii::$app->params['trusteeship']['node_'. $platform_id];
$page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 15);
$status = Yii::$app->request->get('status', '');
$search = Yii::$app->request->get('search', '');
$start_time = Yii::$app->request->get('start_time', '');
$end_time = Yii::$app->request->get('end_time', '');
$params = [
'page' => $page,
'size' => $size,
'status' => $status,
'search' => $search,
'start_time' => $start_time,
'end_time' => $end_time
];
$time = time();
$appKey = isset($node_params['appKey']) ? $node_params['appKey'] : null;
$appSecret = isset($node_params['appSecret']) ? $node_params['appSecret'] : null;
$signature = self::getSign($params, $appKey, $appSecret, $time);
$headers = [
'FZM-Wallet-Signature' => $signature,
'FZM-Wallet-Timestamp' => $time,
'FZM-Wallet-AppKey' => $appKey,
'FZM-Wallet-AppIp' => Yii::$app->request->userIP
];
$service = new TrusteeShipService($node_params, $headers);
$result = $service->getManualList($params);
if (200 !== $result['code']) {
return ['code' => $result['code'], 'data' => [], 'msg' => $result['msg']];
}
return ['code' => 1, 'data' => $result['msg'], 'msg' => 'success'];
}
public function actionVerify()
{
$current_platform_id = Yii::$app->request->getPlatformId();
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])){
return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通'];
}
$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){
return ['code' => -1, 'data' => [], 'msg' => '参数错误'];
}
$params = [
'uid' => $uid,
];
$time = time();
$appKey = isset($node_params['appKey']) ? $node_params['appKey'] : null;
$appSecret = isset($node_params['appSecret']) ? $node_params['appSecret'] : null;
$signature = self::getSign($params, $appKey, $appSecret, $time);
$headers = [
'FZM-Wallet-Signature' => $signature,
'FZM-Wallet-Timestamp' => $time,
'FZM-Wallet-AppKey' => $appKey,
'FZM-Wallet-AppIp' => Yii::$app->request->userIP
];
$service = new TrusteeShipService($node_params, $headers);
if ('verify' == strtolower($action)) {
$result = $service->verifyReal($params);
}
if ('refuse' == strtolower($action)) {
$result = $service->refuseReal($params);
}
if ('revoke' == strtolower($action)) {
$result = $service->revokeReal($params);
}
if (200 !== $result['code']) {
return ['code' => $result['code'], 'data' => [], 'msg' => $result['msg']];
}
return ['code' => 1, 'data' => $result['msg'], 'msg' => 'success'];
}
}
\ No newline at end of file
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