public function oauth_login() { $id = IFilter::act(IReq::get('id'), 'int'); $callback = IFilter::act(IReq::get('callback'), 'text'); //记录回调地址 ISafe::set('callback', $callback); if ($id) { $oauthObj = new Oauth($id); $result = array('isError' => false, 'url' => $oauthObj->getLoginUrl()); ISession::set('oauth', $id); } else { $result = array('isError' => true, 'message' => '请选择要登录的平台'); } echo JSON::encode($result); }