1
This commit is contained in:
parent
2a6fa5be83
commit
2c2d5ca9b9
@ -205,6 +205,8 @@ class User(object):
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['is_retry', 0, '是否重试 0:不用重试 1:重试'],
|
||||
['retry_time', 0, '重试时间(单位秒)'],
|
||||
]
|
||||
},
|
||||
]
|
||||
|
@ -805,7 +805,38 @@ class UserController extends BaseAuthedController {
|
||||
|
||||
public function updateAddressBind()
|
||||
{
|
||||
$hero_uniid = getReqVal('jwt', '');
|
||||
error_log(json_encode($_REQUEST));
|
||||
$jwt = getReqVal('jwt', '');
|
||||
|
||||
$arr = explode('.', $jwt);
|
||||
if (count($arr) < 3) {
|
||||
phpcommon\sendError(1, 'token error');
|
||||
die();
|
||||
return;
|
||||
}
|
||||
$header = base64_decode($arr[0]);
|
||||
$payload = base64_decode($arr[1]);
|
||||
$sign = base64_decode($arr[2]);
|
||||
$data = json_decode($payload, true);
|
||||
|
||||
$url = 'https://pay.cebggame.com/wallet/info?';
|
||||
$params = array(
|
||||
'token' => $jwt
|
||||
);
|
||||
$response = '';
|
||||
if (!phpcommon\HttpClient::get
|
||||
($url,
|
||||
$params,
|
||||
$response)) {
|
||||
myself()->_rspErr(500, 'server internal error');
|
||||
die();
|
||||
return;
|
||||
}
|
||||
error_log($response);
|
||||
$rspObj = json_decode($response, true);
|
||||
User::Update(array(
|
||||
'address' => $rspObj['address']
|
||||
));
|
||||
$this->_rspOk();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user