Browse Source

Merge pull request '接口白名单' (#105) from wpd_white into master

Reviewed-on: #105
master
pengda 4 days ago
parent
commit
9d5a103a38
  1. 18
      index.php

18
index.php

@ -69,6 +69,18 @@
session_write_close(); session_write_close();
} }
if($_POST['str'] == FREE_LOGIN_STR){
$white_list = array(
'index' => array(
'ajax_get_medical_book_list'
),
'weibo' => array(
'ajax_weibo_list', 'ajax_hot_list'
),
);
if ($white_list[$this->control_name] && in_array($this->control_func, $white_list[$this->control_name])) return true;
}
//登陆检查 //登陆检查
$needlogin = true; $needlogin = true;
if ($this->control_name == 'index') { if ($this->control_name == 'index') {
@ -83,12 +95,6 @@
$needlogin = false; $needlogin = false;
} }
if($_POST['str'] == FREE_LOGIN_STR){
$needlogin = false;
if($this->control_name !== 'weibo' || $this->control_func == 'home') $this->ajax_json(false, '暂无权限');
}
if($_GET['str'] == FREE_DOWNLOAD_STR && $this->control_name == 'index' && $this->control_func == 'down_mp_article'){ if($_GET['str'] == FREE_DOWNLOAD_STR && $this->control_name == 'index' && $this->control_func == 'down_mp_article'){
$needlogin = false; $needlogin = false;
} }

Loading…
Cancel
Save