【修复】申请证书中CA强制邮箱关联的问题

This commit is contained in:
chudong
2025-05-23 17:46:02 +08:00
parent 85ff88c502
commit febe33dfd6
74 changed files with 128 additions and 96 deletions

View File

@@ -21,15 +21,18 @@ import { $t } from '@locales/index'
* path="form.eabId"
* v-model:value="formValue.eabId"
* v-model:ca="formValue.ca"
* v-model:email="formValue.email"
* />
*
* @property {string} path - 表单路径,用于表单校验。
* @property {string} value - 当前选中的值 (通过 v-model:value 绑定)。
* @property {string} ca - 当前选中的CA类型 (通过 v-model:ca 绑定)。
* @property {string} email - 邮箱地址 (通过 v-model:email 绑定),当 value 不为空时会被自动赋值。
* @property {boolean} [disabled=false] - 是否禁用。
* @property {string} [customClass] - 自定义CSS类名。
*
* @emits update:value - (value: { value: string; ca: string }) 当选择的CA授权变更时触发传递值和CA类型。
* @emits update:email - (email: string) 当 value 不为空时触发,传递邮箱地址。
*/
export default defineComponent<CAProviderSelectProps>({
name: 'CAProviderSelect',
@@ -47,6 +50,10 @@ export default defineComponent<CAProviderSelectProps>({
type: String,
required: true,
},
email: {
type: String,
required: true,
},
disabled: {
type: Boolean,
default: false,
@@ -58,6 +65,7 @@ export default defineComponent<CAProviderSelectProps>({
},
emits: {
'update:value': (value: { value: string; ca: string }) => true,
'update:email': (email: string) => true,
},
setup(props: CAProviderSelectProps, { emit }: { emit: CAProviderSelectEmits }) {
const {

View File

@@ -6,6 +6,7 @@ export interface CAProviderOption {
label: string
value: string
ca: string
email: string
}
/**
@@ -28,6 +29,11 @@ export interface CAProviderSelectProps {
* @description 当前选中的CA类型
*/
ca: string
/**
* @property email
* @description 邮箱地址,当 value 不为空时会被赋值
*/
email: string
/**
* @property disabled
* @description 是否禁用选择器
@@ -46,7 +52,8 @@ export interface CAProviderSelectProps {
* @description CAProviderSelect 组件的 Emits 定义
*/
export interface CAProviderSelectEmits {
(e: 'update:value', value: { value: string; ca: string }): void
(e: 'update:value', value: { value: string; ca: string; email: string }): void
(e: 'update:email', email: string): void
}
/**

View File

@@ -22,6 +22,7 @@ export function useCAProviderSelectController(props: CAProviderSelectProps, emit
label: '',
value: '',
ca: '',
email: '',
})
const caProviderRef = ref<CAProviderOption[]>([])
const isLoading = ref(false)
@@ -47,6 +48,7 @@ export function useCAProviderSelectController(props: CAProviderSelectProps, emit
label: selectedProvider.label,
value: selectedProvider.value,
ca: selectedProvider.ca,
email: selectedProvider.email,
}
} else if (caProviderRef.value.length > 0 && param.value.value === '') {
// 如果 param.value 为空(例如初始状态或清空后),且 caProviderRef 列表不为空,则默认选中第一个
@@ -54,9 +56,16 @@ export function useCAProviderSelectController(props: CAProviderSelectProps, emit
label: caProviderRef.value[0]?.label || '',
value: caProviderRef.value[0]?.value || '',
ca: caProviderRef.value[0]?.ca || '',
email: caProviderRef.value[0]?.email || '',
}
}
emit('update:value', { value: param.value.value, ca: param.value.ca })
// 当 value 不为空时,将其赋值给 email 字段
if (param.value.value !== '') {
emit('update:email', param.value.email)
}
emit('update:value', { value: param.value.value, ca: param.value.ca, email: param.value.email })
}
/**
@@ -82,6 +91,7 @@ export function useCAProviderSelectController(props: CAProviderSelectProps, emit
label: "Let's Encrypt",
value: '',
ca: 'letsencrypt',
email: '',
}
// 获取其他CA授权列表
@@ -90,6 +100,7 @@ export function useCAProviderSelectController(props: CAProviderSelectProps, emit
label: item.name,
value: item.id.toString(),
ca: item.ca,
email: item.mail,
}))
// 合并选项Let's Encrypt在首位

View File

@@ -113,6 +113,7 @@ nodeOptions[APPLY] = () =>
provider: '',
provider_id: '',
algorithm: 'RSA2048',
skip_check: 0,
},
childNode: null,
},

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "إضافة Zerossl، Google، تفويض CA مخصص",
"t_0_1744098811152": "تحذير: لقد دخلتم منطقة غير معروفة، الصفحة التي تحاول زيارتها غير موجودة، يرجى الضغط على الزر للعودة إلى الصفحة الرئيسية.",
"t_1_1744098801860": "رجوع إلى الصفحة الرئيسية",
"t_2_1744098804908": "نصيحة أمنية: إذا كنت تعتقد أن هذا خطأ، يرجى الاتصال بالمدير على الفور",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "عنوان الوكيل (اختياري)",
"t_8_1747990235316": "يدعم فقط عناوين الوكيل http أو https (مثال: http://proxy.example.com:8080)",
"t_9_1747990229640": "وقت التجديد التلقائي لا يمكن أن يكون فارغًا",
"t_10_1747990232207": "الرجاء اختيار اسم الموقع (يدعم اختيارات متعددة)"
"t_10_1747990232207": "الرجاء اختيار اسم الموقع (يدعم اختيارات متعددة)",
"t_0_1747990626044": "إضافة Zerossl، Google، تفويض CA مخصص"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "Add Zerossl, Google, custom CA authorization",
"t_0_1744098811152": "Warning: You have entered an unknown area, the page you are visiting does not exist, please click the button to return to the homepage.",
"t_1_1744098801860": "Return Home",
"t_2_1744098804908": "Safety Tip: If you think this is an error, please contact the administrator immediately",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "Proxy Address (Optional)",
"t_8_1747990235316": "Only supports http or https proxy addresses (e.g., http://proxy.example.com:8080)",
"t_9_1747990229640": "Auto-renewal time cannot be empty",
"t_10_1747990232207": "Please select the website name, multiple selections are supported"
"t_10_1747990232207": "Please select the website name, multiple selections are supported",
"t_0_1747990626044": "Add Zerossl, Google, custom CA authorization"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "Agregar Zerossl, Google, autorización CA personalizada",
"t_0_1744098811152": "Advertencia: Ha ingresado a una zona desconocida, la página que intenta visitar no existe, por favor, haga clic en el botón para regresar a la página de inicio.",
"t_1_1744098801860": "Volver al inicio",
"t_2_1744098804908": "Consejo de seguridad: Si piensa que es un error, póngase en contacto con el administrador inmediatamente",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "Dirección de Proxy (Opcional)",
"t_8_1747990235316": "Solo admite direcciones proxy http o https (por ejemplo, http://proxy.example.com:8080)",
"t_9_1747990229640": "El tiempo de renovación automática no puede estar vacío",
"t_10_1747990232207": "Por favor, seleccione el nombre del sitio web (se admiten múltiples selecciones)"
"t_10_1747990232207": "Por favor, seleccione el nombre del sitio web (se admiten múltiples selecciones)",
"t_0_1747990626044": "Agregar Zerossl, Google, autorización CA personalizada"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "Ajouter Zerossl, Google, autorisation CA personnalisée",
"t_0_1744098811152": "Avertissement : Vous avez entré dans une zone inconnue, la page que vous visitez n'existe pas, veuillez cliquer sur le bouton pour revenir à la page d'accueil.",
"t_1_1744098801860": "Retour à l'accueil",
"t_2_1744098804908": "Avis de sécurité : Si vous pensez que c'est une erreur, veuillez contacter l'administrateur immédiatement",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "Adresse proxy (facultatif)",
"t_8_1747990235316": "Ne prend en charge que les adresses proxy http ou https (par exemple, http://proxy.example.com:8080)",
"t_9_1747990229640": "L'heure de renouvellement automatique ne peut pas être vide",
"t_10_1747990232207": "Veuillez sélectionner le nom du site (sélection multiple prise en charge)"
"t_10_1747990232207": "Veuillez sélectionner le nom du site (sélection multiple prise en charge)",
"t_0_1747990626044": "Ajouter Zerossl, Google, autorisation CA personnalisée"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "Zerossl、Googleを追加、カスタムCA認証",
"t_0_1744098811152": "警告:未知のエリアに進入しました。アクセスしようとしたページは存在しません。ボタンをクリックしてホームページに戻ってください。",
"t_1_1744098801860": "ホームに戻る",
"t_2_1744098804908": "安全注意:これが誤りだと思われる場合は、すぐに管理者に連絡してください",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "プロキシアドレス(オプション)",
"t_8_1747990235316": "http または https プロキシアドレスのみサポートしていますhttp://proxy.example.com:8080",
"t_9_1747990229640": "自動更新時間は空にできません",
"t_10_1747990232207": "ウェブサイト名を選択してください(複数選択可)"
"t_10_1747990232207": "ウェブサイト名を選択してください(複数選択可)",
"t_0_1747990626044": "Zerossl、Googleを追加、カスタムCA認証"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "Zerossl, Google 추가, 사용자 정의 CA 인증",
"t_0_1744098811152": "경고: 알 수 없는 영역에 진입했습니다. 방문하려는 페이지가 존재하지 않습니다. 버튼을 클릭하여 홈페이지로 돌아가세요。",
"t_1_1744098801860": "홈으로 돌아가기",
"t_2_1744098804908": "안전 유의사항: 이가 오류라면 즉시 관리자에게 연락하십시오",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "프록시 주소(선택 사항)",
"t_8_1747990235316": "http 또는 https 프록시 주소만 지원합니다 (예: http://proxy.example.com:8080)",
"t_9_1747990229640": "자동 갱신 시간은 비워 둘 수 없습니다",
"t_10_1747990232207": "웹사이트 이름을 선택하세요 (다중 선택 가능)"
"t_10_1747990232207": "웹사이트 이름을 선택하세요 (다중 선택 가능)",
"t_0_1747990626044": "Zerossl, Google 추가, 사용자 정의 CA 인증"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "Adicionar Zerossl, Google, autorização CA personalizada",
"t_0_1744098811152": "Aviso: Você entrou em uma área desconhecida, a página que você está visitando não existe, por favor, clique no botão para voltar para a página inicial.",
"t_1_1744098801860": "Voltar para a homepage",
"t_2_1744098804908": "Dica de Segurança: Se você acha que isso é um erro, entre em contato com o administrador imediatamente",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "Endereço de Proxy (Opcional)",
"t_8_1747990235316": "Apenas suporta endereços de proxy http ou https (por exemplo, http://proxy.example.com:8080)",
"t_9_1747990229640": "O tempo de renovação automática não pode estar vazio",
"t_10_1747990232207": "Por favor, selecione o nome do site (seleção múltipla suportada)"
"t_10_1747990232207": "Por favor, selecione o nome do site (seleção múltipla suportada)",
"t_0_1747990626044": "Adicionar Zerossl, Google, autorização CA personalizada"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "Добавить Zerossl, Google, пользовательскую авторизацию CA",
"t_0_1744098811152": "Предупреждение: Вы вошли в неизвестную зону, посещаемая страница не существует, пожалуйста, нажмите кнопку, чтобы вернуться на главную страницу.",
"t_1_1744098801860": "Вернуться на главную",
"t_2_1744098804908": "Совет по безопасности: Если вы считаете, что это ошибка, немедленно свяжитесь с администратором",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "Адрес прокси (опционально)",
"t_8_1747990235316": "Поддерживаются только прокси-адреса http или https (например, http://proxy.example.com:8080)",
"t_9_1747990229640": "Время автоматического продления не может быть пустым",
"t_10_1747990232207": "Пожалуйста, выберите название веб-сайта (поддерживается множественный выбор)"
"t_10_1747990232207": "Пожалуйста, выберите название веб-сайта (поддерживается множественный выбор)",
"t_0_1747990626044": "Добавить Zerossl, Google, пользовательскую авторизацию CA"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "添加Zerossl、Google自定义CA授权",
"t_0_1744098811152": "警告:您已进入未知区域,所访问的页面不存在,请点击按钮返回首页。",
"t_1_1744098801860": "返回首页",
"t_2_1744098804908": "安全提示:如果您认为这是个错误,请立即联系管理员",
@@ -622,5 +621,6 @@
"t_7_1747990227761": "代理地址(可选)",
"t_8_1747990235316": "仅支持 http 或 https 代理地址例如http://proxy.example.com:8080",
"t_9_1747990229640": "自动续签时间不能为空",
"t_10_1747990232207": "请选择网站名,支持多选网站名称"
"t_10_1747990232207": "请选择网站名,支持多选网站名称",
"t_0_1747990626044": "添加Zerossl、Google自定义CA授权"
}

View File

@@ -1,5 +1,4 @@
{
"t_0_1747990626044": "新增Zerossl、Google自訂CA授權",
"t_0_1744098811152": "警告:您已進入未知區域,所訪問的頁面不存在,請點擊按鈕返回首頁。",
"t_1_1744098801860": "返回首頁",
"t_2_1744098804908": "安全提示:如果您認為這是個錯誤,請立即聯繫管理員",
@@ -621,5 +620,6 @@
"t_7_1747990227761": "代理地址(可選)",
"t_8_1747990235316": "僅支援 http 或 https 代理地址例如http://proxy.example.com:8080",
"t_9_1747990229640": "自動續簽時間不能為空",
"t_10_1747990232207": "請選擇網站名,支援多選網站名稱"
"t_10_1747990232207": "請選擇網站名,支援多選網站名稱",
"t_0_1747990626044": "新增Zerossl、Google自訂CA授權"
}

View File

@@ -200,6 +200,7 @@ export interface EabItem {
name: string
Kid: string
HmacEncoded: string
mail: string
ca: string
create_time: string
update_time: string

View File

@@ -1,12 +1,10 @@
import { useRouter, type Router } from 'vue-router'
import { useRouter } from 'vue-router'
import { NButton } from 'naive-ui'
import { useThemeCssVar } from '@baota/naive-ui/theme'
import { $t } from '@locales/index' // 引入 $t
import { $t } from '@locales/index'
// 错误图标
// Changed default color to use a theme variable (textColor1)
const errorIcon = (size: number = 16, color: string = 'var(--n-text-color-1)') => {
const errorIcon = (size: number = 16, color: string) => {
return (
<svg width={size} height={size} viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill={color}>
<path
@@ -20,47 +18,42 @@ const errorIcon = (size: number = 16, color: string = 'var(--n-text-color-1)') =
export default defineComponent({
setup() {
// 路由实例
const router: Router = useRouter()
// 获取主题变量
// Added textColor1 for the errorIcon default color
const cssVar = useThemeCssVar(['baseColor','textColorBase', 'textColorSecondary', 'textColorDisabled', 'textColorInverse', 'textColor1'])
const router = useRouter()
const cssVar = useThemeCssVar(['baseColor', 'textColorBase', 'textColorSecondary', 'textColorDisabled'])
return () => (
<div class="flex flex-col items-center justify-center min-h-screen p-4" style={cssVar.value}> {/* Added p-4 for mobile padding */}
<div class="text-center px-4 sm:px-8 max-w-[60rem] mx-auto"> {/* Responsive horizontal padding */}
<div class="flex flex-col items-center justify-center min-h-screen p-4" style={cssVar.value}>
<div class="text-center px-4 sm:px-8 max-w-[60rem] mx-auto">
<div
// Responsive font size and margin
class="text-[4.5rem] sm:text-[6rem] md:text-[8rem] font-bold leading-none mb-2 sm:mb-4"
style={{
color: 'var(--n-text-color-base)', // Use theme variable for color
textShadow: '2px 2px 8px rgba(0,0,0,0.25)', // Existing text shadow
color: 'var(--n-text-color-base)',
textShadow: '2px 2px 8px rgba(0,0,0,0.25)',
}}
>
404
</div>
{/* Responsive margin; Icon color explicitly set to cardColor to match "404" text */}
<div class="flex items-center justify-center mb-4 sm:mb-8">
{errorIcon(60, 'var(--n-text-color-base)')}
</div>
{/* Responsive font size and margin */}
<div class="text-[1.2rem] sm:text-[1.5rem] md:text-[1.8rem] mb-4 sm:mb-8" style={{ color: 'var(--n-text-color-secondary)' }}>
<div class="flex items-center justify-center mb-4 sm:mb-8">{errorIcon(60, 'var(--n-text-color-base)')}</div>
<div
class="text-[1.2rem] sm:text-[1.5rem] md:text-[1.8rem] mb-4 sm:mb-8"
style={{ color: 'var(--n-text-color-secondary)' }}
>
{$t('t_0_1744098811152')}
</div>
<NButton
// Button colors from theme variables
style={{
backgroundColor: 'var(--n-text-color-base)',
color: 'var(--n-base-color)',
border: 'none'
border: 'none',
}}
onClick={() => router.push('/')}
>
{$t('t_1_1744098801860')}
</NButton>
{/* Responsive margin and font size */}
<div class="mt-4 sm:mt-8 text-[1rem] sm:text-[1.1rem] md:text-[1.3rem]" style={{ color: 'var(--n-text-color-disabled)' }}>
<div
class="mt-4 sm:mt-8 text-[1rem] sm:text-[1.1rem] md:text-[1.3rem]"
style={{ color: 'var(--n-text-color-disabled)' }}
>
{$t('t_2_1744098804908')}
</div>
</div>

View File

@@ -56,6 +56,7 @@ export default defineComponent({
useFormInput($t('t_1_1745735764953'), 'email', {
placeholder: $t('t_2_1745735773668'),
allowInput: noSideSpace,
readonly: param.value.ca !== 'letsencrypt',
}),
{
type: 'custom' as const,
@@ -101,11 +102,13 @@ export default defineComponent({
<CAProviderSelect
path="eabId"
value={param.value.eabId}
email={param.value.email}
ca={param.value.ca}
{...{
'onUpdate:value': (val: { value: string; ca: string }) => {
'onUpdate:value': (val: { value: string; ca: string; email: string }) => {
param.value.eabId = val.value
param.value.ca = val.ca
if (val.value) param.value.email = val.email
},
}}
/>
@@ -148,7 +151,15 @@ export default defineComponent({
},
{ showRequireMark: false },
),
useFormSwitch($t('t_2_1747106957037'), 'skip_check', {}, { showRequireMark: false }),
useFormSwitch(
$t('t_2_1747106957037'),
'skip_check',
{
checkedValue: 1,
uncheckedValue: 0,
},
{ showRequireMark: false },
),
]
: []),
useFormHelp([