user_token验证接口

master
zhanglingsheng 5 years ago
parent 0171360523
commit 6b06e1e6f1

@ -11,9 +11,12 @@ class BaseController extends RestController{
'Apple.apple_platform_pay','Spend.notice','Apple.apple_union_pay','WapPay.wap_shortcut_pay', 'Apple.apple_platform_pay','Spend.notice','Apple.apple_union_pay','WapPay.wap_shortcut_pay',
'WapPay.shortcut_pay','WapPay.android_shortcut_pay','WapPay.wap_shortcut_pay','WapPay.wap_shortcut_pay', 'WapPay.shortcut_pay','WapPay.android_shortcut_pay','WapPay.wap_shortcut_pay','WapPay.wap_shortcut_pay',
'Apple.apple_weixin_pay','Ipa365','User.user_login','user_register','platform_coin_deduction','get_user_money', 'Apple.apple_weixin_pay','Ipa365','User.user_login','user_register','platform_coin_deduction','get_user_money',
'file_pay','pay','GameGiftPage','UserH', 'PayH5','init_sdk','sign_contract', 'Apple','Shortcut' 'file_pay','pay','GameGiftPage','UserH', 'PayH5','init_sdk','sign_contract', 'Apple','Shortcut',
// 'test','Game.get_suspend', // 'test','Game.get_suspend',
];
protected $noToken = [
'user_login', 'user_info', 'send_sms', 'verify_sms', 'forget_password'
]; ];
// 不需要验证TOKEN的接口 // 不需要验证TOKEN的接口
protected $noNeedToken = [ protected $noNeedToken = [
@ -34,9 +37,12 @@ class BaseController extends RestController{
$a = ACTION_NAME; $a = ACTION_NAME;
$data = json_decode ( base64_decode ( file_get_contents ( "php://input" ) ), true ); $data = json_decode ( base64_decode ( file_get_contents ( "php://input" ) ), true );
if (!(in_array($c, $this->noNeedGame) if ((!(in_array($c, $this->noNeedGame)
|| in_array($a, $this->noNeedGame) || in_array($a, $this->noNeedGame)
|| in_array($c.".".$a, $this->noNeedGame))) { || in_array($c.".".$a, $this->noNeedGame))) &&
(!(in_array($c, $this->noToken)
|| in_array($a, $this->noToken)
|| in_array($c.".".$a, $this->noToken)))) {
if ($data['api_ver'] == 2) { if ($data['api_ver'] == 2) {
$userToken = M('user_token', 'tab_')->where([ $userToken = M('user_token', 'tab_')->where([
'user_id' => $data['user_id'], 'user_id' => $data['user_id'],

Loading…
Cancel
Save