public function run() { $rndCodeStr = implode(',', YucMath::getCheckCode(5, 2)); $code = urlencode(base64_encode(YucCrypt::encrypt($rndCodeStr, YucMath::erypt_key()))); $c_id = YucMath::getMultiSerialId(2, 10); $plugin_path = dirname($this->_context->baseDir()); $imgsrc = YucServer::getServerUrl() . "{$plugin_path}/image.php?I_S={$c_id}&mass={$code}"; $renderid = $this->_context->get('renderid', ''); echo "yuc_site_config.{$renderid}=" . json_encode(array('imgsrc' => $imgsrc, 'mass' => $code, "result" => array("code" => 0, 'details' => ''))); }
/** * 本地的公共参数 * @return type */ public function getComParams() { $ret = array(); $ret['localserver'] = YucServer::getServerDomain(); $ret['localport'] = YucServer::getServerPort(); $ret['installdir'] = $this->_plugin_path; $ret['charset'] = YApp::getConfig('YUC_RESPONSE_CHARSET'); return $ret; }