|
|
@@ -2,7 +2,6 @@
|
|
|
|
|
|
namespace ThirdParty\Urs\Request;
|
|
|
|
|
|
-use App\Module\ThirdParty\Services\BaseRequest;
|
|
|
use ThirdParty\Urs\Util\CryptoService;
|
|
|
|
|
|
/**
|
|
|
@@ -13,14 +12,7 @@ use ThirdParty\Urs\Util\CryptoService;
|
|
|
*/
|
|
|
class UrsGetUserLevelCountRequest extends BaseRequest
|
|
|
{
|
|
|
- /**
|
|
|
- * 构造函数
|
|
|
- */
|
|
|
- public function __construct()
|
|
|
- {
|
|
|
- // 使用'urs'作为服务代码,需要在thirdparty_services表中注册
|
|
|
- parent::__construct('urs');
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 处理获取用户下级统计请求
|
|
|
@@ -41,10 +33,11 @@ class UrsGetUserLevelCountRequest extends BaseRequest
|
|
|
}
|
|
|
|
|
|
// 获取URS配置
|
|
|
- $config = $this->getConfig();
|
|
|
- $apiUrl = $config['api_url'] ?? '';
|
|
|
- $appKey = $config['app_key'] ?? '';
|
|
|
- $ecologyId = $config['ecology_id'] ?? 1;
|
|
|
+ $c = $this->getUrsCredential();
|
|
|
+
|
|
|
+ $apiUrl = $this->getService()->base_url; // 直接使用服务的base_url
|
|
|
+ $appKey = $c->getApiKey();
|
|
|
+ $ecologyId = $c->getEcologyId(); // 修复:应该获取ecologyId而不是apiKey
|
|
|
|
|
|
if (empty($apiUrl) || empty($appKey)) {
|
|
|
throw new \Exception('URS配置不完整,缺少api_url或app_key');
|
|
|
@@ -69,7 +62,7 @@ class UrsGetUserLevelCountRequest extends BaseRequest
|
|
|
// 解密响应数据
|
|
|
if (isset($response['data'], $response['iv'], $response['timestamp'], $response['sign'])) {
|
|
|
$decryptedResponse = $cryptoService->decrypt($response);
|
|
|
-
|
|
|
+
|
|
|
return [
|
|
|
'success' => true,
|
|
|
'message' => '获取用户下级统计成功',
|