This commit is contained in:
aozhiwei 2023-06-08 13:11:55 +08:00
parent 2a6fa5be83
commit 2c2d5ca9b9
2 changed files with 34 additions and 1 deletions

View File

@ -205,6 +205,8 @@ class User(object):
],
'response': [
_common.RspHead(),
['is_retry', 0, '是否重试 0:不用重试 1:重试'],
['retry_time', 0, '重试时间(单位秒)'],
]
},
]

View File

@ -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();
}