feat:實作 Member Portal MVP 前端與後端整合

後端:
- 新增 DivingOffer Model / DivingOfferController(列表+詳情 API,支援搜尋/篩選/分頁)
- 修正 Google OAuth callback 改為 redirect 至前端(SocialAuthController)
- 新增 config/cors.php 允許前端 origin
- .gitignore 新增 frontend/ 排除規則

前端(frontend/):
- Vue 3 + Vite + Tailwind CSS + Pinia + Vue Router
- 頁面:首頁、課程列表、課程詳情、登入、註冊、個人資料、OAuth callback
- 整合至 Docker(multi-stage build,nginx 靜態服務於 port 5173)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 01:41:28 +08:00
parent 725c86f434
commit 550e2fc97a
48 changed files with 5887 additions and 17 deletions
+48
View File
@@ -0,0 +1,48 @@
<script setup>
import { useAuthStore } from '../stores/auth'
import { useRouter } from 'vue-router'
const auth = useAuthStore()
const router = useRouter()
async function handleLogout() {
await auth.logout()
router.push('/login')
}
</script>
<template>
<nav class="bg-ocean-800 text-white shadow-md">
<div class="max-w-6xl mx-auto px-4 h-16 flex items-center justify-between">
<RouterLink to="/" class="text-xl font-bold tracking-wide hover:text-ocean-100 transition">
🤿 CFDive
</RouterLink>
<div class="flex items-center gap-6 text-sm font-medium">
<RouterLink to="/courses" class="hover:text-ocean-100 transition">探索課程</RouterLink>
<template v-if="auth.isLoggedIn">
<span class="text-ocean-200 hidden sm:inline">
👤 {{ auth.user?.name }}
</span>
<RouterLink to="/profile" class="hover:text-ocean-100 transition">個人資料</RouterLink>
<button
@click="handleLogout"
class="bg-ocean-600 hover:bg-ocean-500 px-4 py-1.5 rounded-full transition"
>
登出
</button>
</template>
<template v-else>
<RouterLink to="/login" class="hover:text-ocean-100 transition">登入</RouterLink>
<RouterLink
to="/register"
class="bg-ocean-600 hover:bg-ocean-500 px-4 py-1.5 rounded-full transition"
>
註冊
</RouterLink>
</template>
</div>
</div>
</nav>
</template>