function QQrcallback() { $cb_arr = QQ_callback(); $login_type = getSessonUserData('login_type'); if ($login_type == 1) { //login $cb_arr['inter_num'] = '0034'; //p_other_login $cb_arr['type'] = 3; //qq:3 $resp_arr = base_fun($cb_arr); //设置userid,这里是默认数据 if ($resp_arr['status'] == 0) { $userid = $resp_arr['out_data']['userid']; // $this->assign('openid', $cb_arr['openid']); // $this->assign('type', $cb_arr['type']); if ($userid > 0) { setSessonUserData('userid', $resp_arr['out_data']['userid']); // if ($resp_arr['out_data']['headpic']) // setvaluebykey('headpic', $resp_arr['out_data']['headpic']); // else // setvaluebykey('headpic', C("defaultheadpic")); // $this->display('Index/binding_success', 'utf-8'); // setvaluebykey('emailnum', isset($resp_arr['out_data']['emailnum']) ? $resp_arr['out_data']['emailnum'] : 0); // setvaluebykey('shopcartnum', isset($resp_arr['out_data']['shopcartnum']) ? $resp_arr['out_data']['shopcartnum'] : 0); // // $bubble = new BubbleController(); // $bubble->querybubbleinfo(); } else { $nick = $cb_arr['nick']; if ($nick) { $nick = $nick . ','; } // $this->assign('bindnick', $nick); // $this->assign('thirdtypename', 'QQ'); // $this->display('cellPhone', 'utf-8'); } } } if ($login_type == 2) { //bind $cb_arr['userid'] = getSessonUserData('userid'); $cb_arr['inter_num'] = '0035'; $cb_arr['type'] = 3; $resp_arr = base_fun($cb_arr); if ($resp_arr['status'] == 0) { //绑定成功 // $this->assign('nick', $cb_arr['nick']); // $this->assign('thirdtypename', 'QQ'); // header("location:" . __ROOT__ . '/index.php/Home/Set/querysafeinfo'); // $this->display('Set/binding', 'utf-8'); } else { //绑定失败 // $this->assign('nick', $cb_arr['nick']); // $this->assign('type', 'QQ'); // $this->display('Set/binding_success', 'utf-8'); // header("location:".__ROOT__.'/index.php/Home/Set/binding_success'); } } }
<?php /* http入口文件.所有的客户端请求都到此文件处理 */ require_once "./InterfaceImpt.php"; $body_arr = json_decode(getRequestBody(), true); //获取包体json数组 //将请求的json数组传入. $resp_arr = base_fun($body_arr); //打印输出结果.并写日志 header("Access-Control-Allow-Origin: *"); iecho($resp_arr, __LINE__);