diff --git a/control/weibo.php b/control/weibo.php index b93a462..bec104f 100644 --- a/control/weibo.php +++ b/control/weibo.php @@ -113,6 +113,8 @@ class weibo extends publicBase { public function ajax_update_cookie() { $cookie = trim($this->get('cookie')); + if(empty($cookie)) $this->ajax_json(false, '参数错误'); + $type = $this->get('type') + 0; $obj = new mWeiboBehavior(); $robj = $obj->initRedis(); diff --git a/model/mSpider.php b/model/mSpider.php index 47b6c3b..6e8057a 100644 --- a/model/mSpider.php +++ b/model/mSpider.php @@ -267,7 +267,8 @@ class mSpider extends mBase { $this->proxy_ip = $ipdata['ip']; $this->proxy_port = $ipdata['port']; - $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);; + $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE); + if(empty($cookie)) $cookie = WEIBO_LOGIN_COOKIE; $url = "https://weibo.com/ajax/statuses/searchProfile?uid={$uid}&page={$page}&hasori=1"; $headers = array( "Cookie: SUB={$cookie}", @@ -378,7 +379,8 @@ class mSpider extends mBase { $this->proxy_ip = $ipdata['ip']; $this->proxy_port = $ipdata['port']; - $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);; + $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE); + if(empty($cookie)) $cookie = WEIBO_LOGIN_COOKIE; $endtime = strtotime("tomorrow"); $url = "https://weibo.com/ajax/statuses/searchProfile?uid={$uid}&page={$page}&endtime={$endtime}&hasret=1&hastext=1&haspic=1&hasvideo=1&hasmusic=1"; $headers = array(