固定自动SSL使用DNS申请泛域名证书
Some checks are pending
Security Checks / security (push) Waiting to run

This commit is contained in:
smail 2026-09-02 02:12:33 +08:00
parent 62fb971b52
commit a85d42bb70
2 changed files with 9 additions and 16 deletions

View File

@ -91,7 +91,7 @@ export function usePage() {
const sslSettings = reactive({
"type": "0",
"challenge": "http",
"challenge": "dns",
"key_path": "./config/ssl/private.key",
"crt_path": "./config/ssl/public.crt",
"paramsList": [],
@ -123,8 +123,7 @@ export function usePage() {
records.some((record) => record.type === 'AAAA')
))
const port = ref(80)
const sslRuntime = ref({})
const sslRuntime = ref({})
const addDomain = () => {
domainSettings.multi_domain.push([])
@ -355,9 +354,11 @@ export function usePage() {
sslSettings.type = "0"
sslSettings.challenge = "dns"
}
if (sslSettings.type === "0") {
sslSettings.challenge = "dns"
}
sslRuntime.value = res.data || {}
port.value = res.data?.port || res.data?.httpPort || 80
return res
return res
}).catch((error) => {
showSetupError(error)
return null
@ -368,7 +369,7 @@ export function usePage() {
fullscreenLoading.value = true;
let sslType = sslSettings.type;
if (sslType === "0" && sslSettings.challenge === "dns") {
if (sslType === "0") {
sslType = "2"
}
@ -717,8 +718,7 @@ export function usePage() {
dnsChallengeNotice,
dnsInfos,
hasDNSIPv6,
port,
addDomain,
addDomain,
setPassword,
getPassword,
getDbConfig,

View File

@ -278,11 +278,6 @@
<div class="desc">
<div class="ssl-title-row">
<h2>{{ lang.setSSL }}</h2>
<div v-if="sslSettings.type === '0' && sslSettings.challenge === 'http' && port !== 80"
class="ssl-port-warning" role="alert">
<strong>{{ lang.warning }}</strong>
<span>{{ lang.autoSSLWarn }}</span>
</div>
</div>
<div class="ssl-title-description">{{ lang.setSSL }}</div>
</div>
@ -298,9 +293,8 @@
<el-form-item :label="lang.ssl_challenge_type" v-if="sslSettings.type === '0'">
<div class="ssl-challenge-select-row">
<el-select class="ssl-type-select" :placeholder="lang.ssl_auto_http" v-model="sslSettings.challenge"
<el-select class="ssl-type-select" :placeholder="lang.ssl_auto_dns" v-model="sslSettings.challenge"
:disabled="fullscreenLoading" @change="handleSSLChallengeChange">
<el-option :label="lang.ssl_auto_http" value="http"/>
<el-option :label="lang.ssl_auto_dns" value="dns"/>
</el-select>
@ -403,7 +397,6 @@ const {
dnsInfos,
hasDNSIPv6,
sslSettings,
port,
dnsChecking,
dnsChallengeNotice,
waitDesc,