diff --git a/Application/Sdk/Controller/BaseController.class.php b/Application/Sdk/Controller/BaseController.class.php index 1572dfcf..c89c199b 100644 --- a/Application/Sdk/Controller/BaseController.class.php +++ b/Application/Sdk/Controller/BaseController.class.php @@ -48,14 +48,11 @@ class BaseController extends RestController{ || in_array($a, $this->noToken) || in_array($c.".".$a, $this->noToken))) { - if ($data['api_ver'] == 2) { - self::apiverify($data['user_id'], $data['game_id'], $data['user_token']); + if (isset($data['api_ver']) && $data['api_ver'] == 2) { + $this->userToken = self::apiverify($data['user_id'], $data['game_id'], $data['user_token']); } } - - $this->userToken = $userToken; - /* * if( !preg_match("/apple_alipay_pay/",GetCurUrl()) &&!preg_match("/apple_weixin_pay/",GetCurUrl()) &&!preg_match("/get_alipay_zmxy_return/",GetCurUrl()) &&!preg_match("/apple_platform_pay/",GetCurUrl()) &&!preg_match("/notice/",GetCurUrl()) &&!preg_match("/apple_union_pay/",GetCurUrl()) &&!preg_match("/test/",GetCurUrl()) &&!preg_match("/wap_shortcut_pay/",GetCurUrl()) &&!preg_match("/shortcut_pay/",GetCurUrl()) &&!preg_match("/android_shortcut_pay/",GetCurUrl()) &&!preg_match("/wap_shortcut_pay/",GetCurUrl()) &&!preg_match("/apple_weixin_pay/",GetCurUrl()) &&!preg_match("/Ipa365/",GetCurUrl()) &&!preg_match("/user_login/",GetCurUrl()) &&!preg_match("/platform_coin_deduction/",GetCurUrl()) ){ */ @@ -122,6 +119,8 @@ class BaseController extends RestController{ exit (); // 退出 } + + return $token; } /* @@ -169,12 +168,13 @@ class BaseController extends RestController{ * @return array 配置数组 */ public static function get_tool(){ - $tools = M('tool', 'tab_')->where([])->field('type,name,config,status')->select(); + $tools = M('tool', 'tab_')->where([])->field('type,name,config,`status`')->select(); $config = array(); foreach ($tools as $value) { $config[$value['name']] = json_decode($value['config'], true); - $config[$value['name']]['status'] = $value['status']; + if (is_array($config[$value['name']])) + $config[$value['name']]['status'] = $value['status']; } return $config; } diff --git a/Application/Sdk/Controller/ExchangeController.class.php b/Application/Sdk/Controller/ExchangeController.class.php index 8f13e4d3..15db73d9 100644 --- a/Application/Sdk/Controller/ExchangeController.class.php +++ b/Application/Sdk/Controller/ExchangeController.class.php @@ -134,6 +134,8 @@ class ExchangeController extends BaseController{ } } + $request['scheme'] = isset($request['scheme']) ? $request['scheme'] : ''; + if($request['code'] == 0) { /* 平台币充值 */ file_put_contents("./Application/Sdk/Scheme/".$request['game_id'].".txt",$request['scheme']); diff --git a/Application/Sdk/Controller/SpendController.class.php b/Application/Sdk/Controller/SpendController.class.php index 3a0b9628..617d215d 100644 --- a/Application/Sdk/Controller/SpendController.class.php +++ b/Application/Sdk/Controller/SpendController.class.php @@ -82,7 +82,7 @@ class SpendController extends Controller { $this->assign ( 'balance', $balance ); $this->assign ( 'bind_balance', $bind_balance ); $this->assign ( 'data', $data ); - $this->assign ( 'btncolor', $request ['btncolor'] ); + $this->assign ( 'btncolor', isset($request['btncolor']) ? $request['btncolor'] : '' ); if ($balance + $bind_balance > $data['price']) { $apply_money = $data['price']; diff --git a/ThinkPHP/Library/Think/Controller/RestController.class.php b/ThinkPHP/Library/Think/Controller/RestController.class.php index 2a626627..14beb0df 100644 --- a/ThinkPHP/Library/Think/Controller/RestController.class.php +++ b/ThinkPHP/Library/Think/Controller/RestController.class.php @@ -115,7 +115,7 @@ class RestController extends Controller { foreach($type as $key=>$val){ $array = explode(',',$val); foreach($array as $k=>$v){ - if(stristr($_SERVER['HTTP_ACCEPT'], $v)) { + if(isset($_SERVER['HTTP_ACCEPT']) && stristr($_SERVER['HTTP_ACCEPT'], $v)) { return $key; } }