|
|
@@ -190,24 +190,21 @@ class Betorder extends BaseController{
|
|
|
|
|
|
public function Bet(){
|
|
|
//如果获取不到data,则为游戏端提交,需转成数组
|
|
|
-
|
|
|
- if(!empty($_REQUEST['json_bet_data'])){
|
|
|
- $data = json_decode($_REQUEST['json_bet_data'],true);
|
|
|
-
|
|
|
- $token = $data['token'];
|
|
|
- dd($token);
|
|
|
-
|
|
|
- $bet_money = $data['bet_money'];
|
|
|
- $data = $data['data'];
|
|
|
- $userInfo = $this->getAgent($token);//获取用户信息
|
|
|
+ if(!empty($_POST['game_data'])){
|
|
|
+ //获取参数转成数组
|
|
|
+ $get_data = json_decode($_POST['game_data'],true);
|
|
|
+ $token = $get_data['token'];
|
|
|
+ $bet_money = $get_data['bet_money'];
|
|
|
+ $data = $get_data['data'];
|
|
|
}else{
|
|
|
$data = $_REQUEST['data'];
|
|
|
$bet_money = $_REQUEST['bet_money'];
|
|
|
$token = $_REQUEST['token'];
|
|
|
- $userInfo = $this->getAgent($token);//获取用户信息
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+ //验证用户token
|
|
|
+ $userInfo = $this->getAgent($token);
|
|
|
+
|
|
|
if(empty($data)||empty($bet_money)){
|
|
|
Render('', '51029',lang('Errors','Api')->get('error-51029'));
|
|
|
}
|