mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-02-21 15:31:12 +08:00
修复华为云部署
This commit is contained in:
parent
92ba34833b
commit
fa9235562a
@ -38,7 +38,7 @@ class Auth extends BaseController
|
||||
$user = Db::name('user')->where('username', $username)->find();
|
||||
if ($user && password_verify($password, $user['password'])) {
|
||||
if ($user['status'] == 0) return json(['code' => -1, 'msg' => '此用户已被封禁', 'vcode' => 1]);
|
||||
if ($user['totp_open'] == 1 && !empty($user['totp_secret'])) {
|
||||
if (isset($user['totp_open']) && $user['totp_open'] == 1 && !empty($user['totp_secret'])) {
|
||||
session('pre_login_user', $user['id']);
|
||||
if (file_exists($login_limit_file)) {
|
||||
unlink($login_limit_file);
|
||||
@ -53,7 +53,7 @@ class Auth extends BaseController
|
||||
} else {
|
||||
if ($user) {
|
||||
Db::name('log')->insert(['uid' => $user['id'], 'action' => '登录失败', 'data' => 'IP:' . $this->clientip, 'addtime' => date("Y-m-d H:i:s")]);
|
||||
if ($user['totp_open'] == 1 && !empty($user['totp_secret'])) $login_limit_count = 10;
|
||||
if (isset($user['totp_open']) && $user['totp_open'] == 1 && !empty($user['totp_secret'])) $login_limit_count = 10;
|
||||
}
|
||||
if (!file_exists($login_limit_file)) {
|
||||
$login_limit = ['count' => 0, 'time' => 0];
|
||||
|
||||
@ -600,6 +600,7 @@ class DeployHelper
|
||||
'type' => 'input',
|
||||
'placeholder' => '',
|
||||
'show' => 'product!=\'clb\'&&product!=\'tke\'',
|
||||
'note' => 'CDN、EO、WAF多个域名可用,隔开,其他只能填写1个域名',
|
||||
'required' => true,
|
||||
],
|
||||
],
|
||||
@ -813,7 +814,7 @@ class DeployHelper
|
||||
'domain' => [
|
||||
'name' => '绑定的域名',
|
||||
'type' => 'input',
|
||||
'placeholder' => '多个域名可使用英文逗号分隔',
|
||||
'placeholder' => '多个域名可使用,分隔',
|
||||
'required' => true,
|
||||
],
|
||||
],
|
||||
@ -1266,7 +1267,7 @@ class DeployHelper
|
||||
];
|
||||
|
||||
public static $class_config = [
|
||||
1 => '自建面板',
|
||||
1 => '自建系统',
|
||||
2 => '云服务商',
|
||||
3 => '服务器',
|
||||
];
|
||||
|
||||
@ -150,6 +150,7 @@ class HuaweiCloud
|
||||
curl_close($ch);
|
||||
throw new Exception('Curl error: ' . curl_error($ch));
|
||||
}
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
$arr = json_decode($response, true);
|
||||
@ -164,7 +165,6 @@ class HuaweiCloud
|
||||
return $arr;
|
||||
}
|
||||
} else {
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
if ($httpCode >= 200 && $httpCode < 300) {
|
||||
return null;
|
||||
} else {
|
||||
|
||||
@ -104,9 +104,14 @@ class tencent implements DeployInterface
|
||||
|
||||
private function deploy_common($product, $cert_id, $instance_id)
|
||||
{
|
||||
if (in_array($product, ['cdn', 'waf', 'teo', 'ddos', 'live', 'vod']) && strpos($instance_id, ',') !== false) {
|
||||
$instance_ids = explode(',', $instance_id);
|
||||
} else {
|
||||
$instance_ids = [$instance_id];
|
||||
}
|
||||
$param = [
|
||||
'CertificateId' => $cert_id,
|
||||
'InstanceIdList' => [$instance_id],
|
||||
'InstanceIdList' => $instance_ids,
|
||||
'ResourceType' => $product,
|
||||
];
|
||||
$data = $this->client->request('DeployCertificateInstance', $param);
|
||||
|
||||
@ -78,6 +78,7 @@ class huawei implements DnsInterface
|
||||
foreach ($data['recordsets'] as $row) {
|
||||
if ($row['name'] == $row['zone_name']) $row['name'] = '@';
|
||||
if ($row['type'] == 'MX') list($row['mx'], $row['records']) = explode(' ', $row['records'][0]);
|
||||
if ($row['type'] == 'TXT') $row['records'] = array_map(function($v){return trim($v, '"');}, $row['records']);
|
||||
$list[] = [
|
||||
'RecordId' => $row['id'],
|
||||
'Domain' => rtrim($row['zone_name'], '.'),
|
||||
@ -111,6 +112,7 @@ class huawei implements DnsInterface
|
||||
if ($data) {
|
||||
if ($data['name'] == $data['zone_name']) $data['name'] = '@';
|
||||
if ($data['type'] == 'MX') list($data['mx'], $data['records']) = explode(' ', $data['records'][0]);
|
||||
if ($data['type'] == 'TXT') $data['records'] = array_map(function($v){return trim($v, '"');}, $data['records']);
|
||||
return [
|
||||
'RecordId' => $data['id'],
|
||||
'Domain' => rtrim($data['zone_name'], '.'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user