1.确认应用密钥及应用ID还有其他参数正确
2.UC配置中心中使用远程链接方式
3.使用discuz-ucenter-api-for-java源码
4.确认通信成功
5.配置文件与uc中配置相同,UC_API:http://192.168.188.130:80/upload/uc_server
------------------------
发现第一问题:
1.getgpc()方法没有成功获取请求参数
所以改成以下方式
function getgpc($k, $var='R') {
$param_str=urldecode(file_get_contents('php://input'));
$param_arr = convertUrlQuery($param_str);
// $_REQUEST = $param_arr;
switch($var) {
case 'G': $var = &$_GET; break;
case 'P': $var = &$_POST; break;
case 'C': $var = &$_COOKIE; break;
//case 'R': $var = &$_REQUEST; break;
case 'R': $var = &$param_arr; break;
}
return isset($var[$k]) ? $var[$k] : NULL;
}
2.然后一直返回 Access denied for agent changed
在 ./upload/uc_server/model/base.php 中的authcode方法一直返回''
if($operation == 'DECODE') {
if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) {
$myfile4 = fopen("php1.txt", "w") or die("Unable to open file!");
fwrite($myfile4, $result);
fclose($myfile4);
return substr($result, 26);
} else {
$myfile5 = fopen("php5.txt", "w") or die("Unable to open file!");
fwrite($myfile5, "this is null");
fclose($myfile5);
return '';
}
} else {
return $keyc.str_replace('=', '', base64_encode($result));
}
|