From 9c690a3dbc25dc0f51021769941337299ef76ba3 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Fri, 22 Nov 2019 01:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BC=E5=8C=85=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/GameGiftPageController.class.php | 4 ++-- Application/Sdk/View/default/GameGiftPage/receive.html | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) 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); } }