get_down_time 不验证user_token

master
tpingzhang 5 years ago
parent 054754f66c
commit 706b05d77a

@ -17,7 +17,8 @@ class BaseController extends RestController{
]; ];
protected $noToken = [ protected $noToken = [
'user_login', 'send_sms', 'verify_sms', 'forget_password', 'user_login', 'send_sms', 'verify_sms', 'forget_password',
'init_sdk', 'device_record', 'force_update', 'thirdparty', 'get_customer_question' 'init_sdk', 'device_record', 'force_update', 'thirdparty', 'get_customer_question',
'get_down_time'
]; ];
// 不需要验证TOKEN的接口 // 不需要验证TOKEN的接口
protected $noNeedToken = [ protected $noNeedToken = [
@ -40,25 +41,31 @@ class BaseController extends RestController{
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 (!(in_array($c, $this->noToken)
if ($data['api_ver'] == 2) { || in_array($a, $this->noToken)
$userToken = M('user_token', 'tab_')->where([ || in_array($c.".".$a, $this->noToken))) {
'user_id' => $data['user_id'],
'game_id' => $data['game_id'] if ($data['api_ver'] == 2) {
])->getField('user_token'); $userToken = M('user_token', 'tab_')->where([
if (!$userToken || $userToken != $data['user_token']) { 'user_id' => $data['user_id'],
echo base64_encode (json_encode(array( 'game_id' => $data['game_id']
"code" => 9999, ])->getField('user_token');
"msg" => "您已下线,请重新登入", if (!$userToken || $userToken != $data['user_token']) {
"data" => "" echo base64_encode (json_encode(array(
))); "code" => 9999,
exit (); "msg" => "您已下线,请重新登入",
// 退出 "data" => ""
)));
exit ();
// 退出
}
} }
} }
$this->userToken = $userToken; $this->userToken = $userToken;
/* /*

Loading…
Cancel
Save