feat: fix compose.yml ;add frontend .env properties

This commit is contained in:
shenjianZ 2025-07-30 13:53:21 +08:00
parent 0e267b923c
commit 2994a48e19
5 changed files with 26 additions and 22 deletions

View File

@ -18,6 +18,7 @@ services:
- compose.env
volumes:
- mysql-data:/var/lib/mysql
- ./backend/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- email-network

2
frontend/.env Normal file
View File

@ -0,0 +1,2 @@
VITE_APP_DOMAIN=shenjianl.cn
VITE_GITEA_URL=https://gitea.shenjianl.cn/shenjianZ/email-unlimit

View File

@ -1,10 +1,14 @@
<script setup>
const giteaUrl = import.meta.env.VITE_GITEA_URL;
</script>
<template>
<header class="app-header">
<router-link to="/" class="logo-link">
<div class="logo">Email Unlimit</div>
</router-link>
<nav class="nav-links">
<a href="https://gitea.shenjianl.cn/shenjianZ/email-unlimit" target="_blank">Gitee</a>
<a :href="giteaUrl" target="_blank">Gitea</a>
<router-link to="/settings" class="settings-link" title="设置">
<img src="@/assets/setting.svg" alt="Settings" class="settings-icon" />
</router-link>

View File

@ -2,7 +2,7 @@
<main id="app-main">
<section class="hero-section">
<h1>{{ $t('home.title') }}</h1>
<p>{{ $t('home.subtitle') }}<code>@shenjianl.cn</code>{{ $t('home.subtitleAfter') }}</p>
<p>{{ $t('home.subtitle') }}<code>@{{ domain }}</code>{{ $t('home.subtitleAfter') }}</p>
<form @submit.prevent="fetchMessages" class="input-group">
<div class="input-wrapper">
<input
@ -105,14 +105,14 @@ if (import.meta.env.DEV) {
selectedMessage.value = {
id: 'sample-1',
sender: 'demo@example.com',
recipient: 'you@shenjianl.cn',
recipient: `you@${domain}`,
subject: 'Markdown 样式测试邮件',
body: `# 会议议程:项目启动会\n\n大家好\n\n这是关于 **“Email-Unlimit”** 项目启动会的议程安排。\n\n---\n\n## 会议详情\n\n- **日期**: 2025年7月30日\n- **时间**: 上午10:00\n- **地点**: 线上会议室 (链接稍后提供)\n\n## 议程\n\n1. **项目介绍** - 介绍项目目标和范围。\n2. **团队分工** - 明确各自的职责。\n3. **技术选型** - 讨论并确认技术栈。\n4. **Q&A** - 自由提问环节。\n\n请准时参加。\n\n谢谢\n\n> 这是一条重要的提醒:请提前准备好您的问题。`
};
}
const loading = ref(false);
const copyStatus = ref('idle'); // 'idle' | 'copied'
const domain = 'shenjianl.cn';
const domain = import.meta.env.VITE_APP_DOMAIN;
const attachments = ref([]);
const attachmentsLoading = ref(false);
const newMailNotification = ref(false);

View File

@ -1,3 +1,17 @@
<script setup>
import { useLanguageStore } from '@/stores/language';
import { computed } from 'vue';
const domain = import.meta.env.VITE_APP_DOMAIN;
const languageStore = useLanguageStore();
const setLanguage = (lang) => {
languageStore.setLocale(lang);
};
const currentLocale = computed(() => languageStore.locale);
</script>
<template>
<div class="settings-page">
<div class="settings-container">
@ -5,7 +19,7 @@
<ol>
<i18n-t keypath="howItWorks.step1" tag="li">
<template #domain>
<code>@{{ 'shenjianl.cn' }}</code>
<code>@{{ domain }}</code>
</template>
</i18n-t>
<li>{{ $t('howItWorks.step2') }}</li>
@ -22,25 +36,8 @@
</template>
<script>
import { useLanguageStore } from '@/stores/language';
import { computed } from 'vue';
export default {
name: 'Settings',
setup() {
const languageStore = useLanguageStore();
const setLanguage = (lang) => {
languageStore.setLocale(lang);
};
const currentLocale = computed(() => languageStore.locale);
return {
setLanguage,
currentLocale,
};
},
};
</script>