修复网宿API验证失败的问题 (#250)

* 变更网宿check方法调用的API接口以避免产品未开通导致验证失败

* 兼容网宿CDN接口使用result作为失败返回值的场景
This commit is contained in:
Hanada 2025-06-19 12:50:46 +08:00 committed by GitHub
parent 5aab54c79e
commit 7f370a095d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,7 @@ class wangsu implements DeployInterface
public function check()
{
if (empty($this->username) || empty($this->apiKey)) throw new Exception('必填参数不能为空');
$this->request('/cdn/certificates');
$this->request('/api/ssl/certificate');
return true;
}
@ -452,6 +452,9 @@ class wangsu implements DeployInterface
} elseif (isset($result['message'])) {
throw new Exception($result['message']);
} elseif (isset($result['result'])) {
throw new Exception($result['result']);
} else {
throw new Exception('请求失败');
}