diff --git a/Application/Sdk/Controller/GameGiftPageController.class.php b/Application/Sdk/Controller/GameGiftPageController.class.php index 0bd001b4..f5805f2f 100644 --- a/Application/Sdk/Controller/GameGiftPageController.class.php +++ b/Application/Sdk/Controller/GameGiftPageController.class.php @@ -143,7 +143,7 @@ class GameGiftPageController extends Controller{ public function receive_gift($user_token = 0,$gift_id = 0,$game_id = 0,$game_name = ""){ #获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组 - $post = I('post.'); + $post = I('request.'); $user_id = $this->userId; $gift_id = $post['gift_id']; $game_id = $post['game_id']; @@ -178,7 +178,7 @@ class GameGiftPageController extends Controller{ $gift->where("id=".$gift_id)->save($act); $ddd['novice'] = $data_record['novice']; echo json_encode([ - 'code' => 0, + 'code' => 1, 'status' => 1, 'msg' => '领取成功' ]); diff --git a/Application/Sdk/View/default/GameGiftPage/receive.html b/Application/Sdk/View/default/GameGiftPage/receive.html index 104f0208..1a93d3b5 100644 --- a/Application/Sdk/View/default/GameGiftPage/receive.html +++ b/Application/Sdk/View/default/GameGiftPage/receive.html @@ -76,11 +76,10 @@ success: function (r) { if (r.code == 200) { window.location.href = r.url; - } else { - if (r == "领取成功") { + } else if(r.code == 1){ window.location.href = "{:U('details',['user_token' => $user_token,'gift_id' => $gift_id,'game_id' => $game_id,'game_name' => $game_name])}"; - } - // alert(r.msg); + }else { + alert(r.msg); } }