1
This commit is contained in:
parent
e36f46a9e9
commit
74fbdf4cf9
@ -137,7 +137,7 @@ class AALogin(object):
|
||||
'url': 'https://login-test.kingsome.cn/webapp/index.php?c=Login&a=verifyJwt',
|
||||
'is_json_params': True,
|
||||
'params': [
|
||||
['data', '', 'jwt'],
|
||||
['jwt', '', 'jwt'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
|
@ -909,49 +909,27 @@ class UserController extends BaseAuthedController {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
error_log(json_encode($_REQUEST));
|
||||
$jwt = getReqVal('jwt', '');
|
||||
|
||||
$arr = explode('.', $jwt);
|
||||
if (count($arr) < 3) {
|
||||
phpcommon\sendError(1, 'token error');
|
||||
die();
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
if (empty($data)) {
|
||||
phpcommon\rspErr(100, 'data error');
|
||||
return;
|
||||
}
|
||||
$header = base64_decode($arr[0]);
|
||||
$payload = base64_decode($arr[1]);
|
||||
$sign = base64_decode($arr[2]);
|
||||
$data = json_decode($payload, true);
|
||||
|
||||
$subIdxPre = '';
|
||||
$subIdx = getXVal($data, 'version', '');
|
||||
if (!empty($subIdx)) {
|
||||
$subIdxPre = 's' . $subIdx . '_';
|
||||
}
|
||||
{
|
||||
$jwtAccountId = BC_POLY_CHANNEL . '_' . myself()->_getGameId() . '_' .
|
||||
$subIdxPre . $data['plat'] . '_' . $data['openid'];
|
||||
if ($jwtAccountId != myself()->_getAccountId()) {
|
||||
myself()->_rspErr(1, 'token error3');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//$url = 'https://pay.cebggame.com/wallet/info?';
|
||||
$url = 'https://oauth-svr.cebggame.com/test/wallet/info?';
|
||||
$params = array(
|
||||
'token' => $jwt
|
||||
'jwt' => $data['jwt']
|
||||
);
|
||||
$response = '';
|
||||
if (!phpcommon\HttpClient::get
|
||||
($url,
|
||||
(LOGIN_URL,
|
||||
$params,
|
||||
$response)) {
|
||||
myself()->_rspErr(500, 'server internal error');
|
||||
die();
|
||||
return;
|
||||
}
|
||||
error_log($response);
|
||||
if (empty($response)) {
|
||||
myself()->_rspErr(500, 'server internal error');
|
||||
return;
|
||||
}
|
||||
$rspObj = json_decode($response, true);
|
||||
if (empty($rspObj['data']['address'])) {
|
||||
User::Update(array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user