diff --git a/Application/Sdk/Controller/BaseController.class.php b/Application/Sdk/Controller/BaseController.class.php index 1624e646..2fcc5f78 100644 --- a/Application/Sdk/Controller/BaseController.class.php +++ b/Application/Sdk/Controller/BaseController.class.php @@ -147,17 +147,17 @@ class BaseController extends RestController{ $user['userId'] = M("user_token", "tab_")->where($where)->getField("user_id"); $user['userToken'] = $userToken; if (!$user['userId']) { - // if (IS_AJAX) { - // echo json_encode([ - // 'code' => 200, - // 'status' => 1, - // 'url' => U('Spend/notice_logout',array('user_id'=>$user['userId'],'game_id'=>I("request.game_id", 0),'msg'=>'您已下线', 'user_token' => $userToken)) - // ]); - // exit(); - // } else { + if (IS_AJAX) { + echo json_encode([ + 'code' => 200, + 'status' => 1, + 'url' => U('Spend/notice_logout',array('user_id'=>$user['userId'],'game_id'=>I("request.game_id", 0),'msg'=>'您已下线', 'user_token' => $userToken)) + ]); + exit(); + } else { redirect(U('Spend/notice_logout',array('user_id'=>$user['userId'],'game_id'=>I("request.game_id", 0),'msg'=>'您已下线', 'user_token' => $userToken))); - // exit; - // } + exit; + } // re_msg(12, $userToken."Token失效"); } diff --git a/Application/Sdk/View/default/GameGiftPage/receive.html b/Application/Sdk/View/default/GameGiftPage/receive.html index 715cc71f..cf720a57 100644 --- a/Application/Sdk/View/default/GameGiftPage/receive.html +++ b/Application/Sdk/View/default/GameGiftPage/receive.html @@ -72,11 +72,10 @@ if(data == '领取成功') { window.location.href = "{:U('details',['user_token' => $user_token,'gift_id' => $gift_id,'game_id' => $game_id,'game_name' => $game_name])}"; - }else + }else if(data.code == 200) { - $("#errormsg").html(data); - $("#iosDialog").show(); - // window.location.href = "{:U('details',['user_token' => $user_token,'gift_id' => $gift_id,'game_id' => $game_id,'game_name' => $game_name])}"; + + window.location.href = data.url; } }); })