From ee57a9cae549c9c4737996fe71bf80d026b41130 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 3 Dec 2019 15:33:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=BF=87=E5=A4=9A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/BaseController.class.php | 11 +++++------ .../Sdk/Controller/ExchangeController.class.php | 2 ++ Application/Sdk/Controller/SpendController.class.php | 2 +- .../Library/Think/Controller/RestController.class.php | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Application/Sdk/Controller/BaseController.class.php b/Application/Sdk/Controller/BaseController.class.php index 1572dfcf..d91c64cd 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,7 +168,7 @@ 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) { 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; } } From 6974ab7abad31d0cf2b78f279ace41046fca1c8f Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 3 Dec 2019 17:09:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=BF=87=E5=A4=9A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/BaseController.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/Sdk/Controller/BaseController.class.php b/Application/Sdk/Controller/BaseController.class.php index d91c64cd..c89c199b 100644 --- a/Application/Sdk/Controller/BaseController.class.php +++ b/Application/Sdk/Controller/BaseController.class.php @@ -173,7 +173,8 @@ class BaseController extends RestController{ $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; }