fix(ui): DevIndexBadge и dev-код подтверждения скрыты в проде (гейт import.meta.env.DEV)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="index" class="dev-index-badge" :class="{ 'is-dialog': dialogMode }">
|
||||
<div v-if="isDev && index" class="dev-index-badge" :class="{ 'is-dialog': dialogMode }">
|
||||
<span class="dev-index-num">{{ index }}</span>
|
||||
<span class="dev-index-label">{{ label }}</span>
|
||||
</div>
|
||||
@@ -22,6 +22,10 @@ defineProps<{
|
||||
label?: string;
|
||||
dialogMode?: boolean;
|
||||
}>();
|
||||
|
||||
// Гейт окружения: бейдж рисуется ТОЛЬКО в dev. В прод-сборке import.meta.env.DEV
|
||||
// = false → бейдж не виден независимо от того, передан ли index хардкодом.
|
||||
const isDev = import.meta.env.DEV;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -40,7 +40,9 @@ onUnmounted(() => {
|
||||
if (cooldownTimer) clearInterval(cooldownTimer);
|
||||
});
|
||||
|
||||
const devCode = computed(() => auth.pendingDevCode);
|
||||
// Код подтверждения показываем ТОЛЬКО в dev (в проде import.meta.env.DEV=false →
|
||||
// null, даже если бэкенд по ошибке вернёт pendingDevCode).
|
||||
const devCode = computed(() => (import.meta.env.DEV ? auth.pendingDevCode : null));
|
||||
const canSubmit = computed(() => /^\d{6}$/.test(code.value) && email.value.length > 0);
|
||||
|
||||
async function handleConfirm() {
|
||||
|
||||
Reference in New Issue
Block a user