public function auth4Space($request, $response) {/*{{{*/ $code = $request->code; $type = $request->type ? $request->type : ''; $proposalId = $request->proposalId ? $request->proposalId : ''; $weixintype = WeixUser::WEIXINTYPE_SPACE; $openid = WeixApi::getOpenIdByCode($code, weixUser::WEIXINTYPE_SPACE); $weixUser = DAL::get()->find_by_openid_and_weixintype('WeixUser', $openid, $weixintype); setcookie("weixSpaceUserId", $weixUser->id, time()+3600*24*365*20, "/", "haodf.com"); if($type != '') { switch($type) { case 1: $response->setRedirect("http://" . URL_PREFIX . "m.haodf.com/touch/weixindoctor/publishstopserviceinfo"); break; case 2: $response->setRedirect("http://" . URL_PREFIX . "m.haodf.com/touch/weixindoctor/modifyclinictime"); break; case 3: $response->setRedirect("http://" . URL_PREFIX . "m.haodf.com/touch/weixindoctor/bindsuccess"); break; case 4: $url = 'http://' . URL_PREFIX . 'm.haodf.com/touch/weixindoctor/replyproposalguide'; $response->setRedirect($url); break; default: echo 'no this page'; break; } } if($proposalId != '') { $url = 'http://'.URL_PREFIX.'m.haodf.com/touch/weixindoctor/proposaldetail?proposalId=' . $proposalId; $response->setRedirect($url); } }/*}}}*/