public function weixinDelete() { $id = intval(I('get.id')); if (empty($id)) { $this->error('访问错误'); } $b = new Bridge($this->addon); $b->remove($id); $this->success('删除接入平台成功', $this->U('connect/weixin')); }
public function exec($message, $processor) { if (!empty($processor)) { $b = new Bridge(null); $platform = $b->getOne($processor['id'], true); $body = $this->toRequestXml($message); $url = $platform['url']; if (!strpos($url, '?') == -1) { $url .= '?'; } else { $url .= '&'; } $params = array('timestamp' => TIMESTAMP, 'nonce' => util_random(10, 1)); $signParams = array($platform['token'], $params['timestamp'], $params['nonce']); sort($signParams, SORT_STRING); $params['signature'] = sha1(implode($signParams)); $url .= http_build_query($params, '', '&'); $ret = Net::httpPost($url, $body); if (!empty($ret)) { return $this->toPacket($ret); } } }