public function confirm() { if (IS_POST) { if ($this->redis->get($this->wx_numberid_name . intval(I('post.numberid'))) && I('post.confirm') == 'true') { $this->redis->setex($this->wx_auth_name . intval(I('post.numberid')), 150, ACPopedom::getID()); //提示登陆成功 header("HTTP/1.1 200"); exit; } else { header("HTTP/1.1 400"); exit; } } $nmberid = authcode(base64_decode(trim(I('get.token'))), "DECODE", SESSION_AUTH); if (!intval($nmberid)) { //解析不成功 $this->ajaxReturn(array('status' => false, 'msg' => '无效的二维码')); } if (!$this->redis->get($this->wx_numberid_name . $nmberid)) { //解析不成功 $this->ajaxReturn(array('status' => false, 'msg' => '此二维码已过期,请刷新页面再扫!')); } //生成扫码通过标识,并绑定扫码带来的numberid $this->redis->setex($this->wx_login_name . $nmberid, 150, ACPopedom::getAvator()); $this->ajaxReturn(array('status' => true, 'numberid' => $nmberid)); }
/** * 安全中心首页 */ public function index() { $sign = ACPopedom::getWechatSign(); $this->assign('wxSdk', $sign); $this->assign('userinfo', array('nickname' => ACPopedom::getNickname(), 'avator' => ACPopedom::getAvator())); $this->display(); }