Compare commits

...
2 Commits
15 changed files with 155 additions and 20 deletions

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
# Author: fruit.com.cn
# 生产构建(vite build 默认 mode=production)专用:官网直连线上客户端接口。
# 本地开发仍读 .env,指向 127.0.0.1:8081,两者互不影响。
VITE_API_BASE_URL=https://drama-api.frostgiant.vip
# 媒资(封面/视频)与接口同域,避免站点域名下 /files 404。
VITE_MEDIA_BASE_URL=https://drama-api.frostgiant.vip
+1
View File
@@ -2,3 +2,4 @@
node_modules/ node_modules/
dist/ dist/
.DS_Store .DS_Store
.env
+7 -7
View File
@@ -10,18 +10,18 @@
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" /> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="description" content="YMB — short stories, big emotions." /> <meta name="description" content="YMB — short stories, big emotions." />
<meta name="robots" content="index,follow,max-image-preview:large" /> <meta name="robots" content="index,follow,max-image-preview:large" />
<link rel="canonical" href="https://ymb.example.com/" /> <link rel="canonical" href="%VITE_SITE_URL%/" />
<link rel="alternate" hreflang="id" href="https://ymb.example.com/?lang=id" /> <link rel="alternate" hreflang="id" href="%VITE_SITE_URL%/?lang=id" />
<link rel="alternate" hreflang="en" href="https://ymb.example.com/?lang=en" /> <link rel="alternate" hreflang="en" href="%VITE_SITE_URL%/?lang=en" />
<link rel="alternate" hreflang="zh-CN" href="https://ymb.example.com/?lang=zh" /> <link rel="alternate" hreflang="zh-CN" href="%VITE_SITE_URL%/?lang=zh" />
<link rel="alternate" hreflang="x-default" href="https://ymb.example.com/" /> <link rel="alternate" hreflang="x-default" href="%VITE_SITE_URL%/" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:site_name" content="YMB" /> <meta property="og:site_name" content="YMB" />
<meta property="og:title" content="YMB · Short stories, big emotions" /> <meta property="og:title" content="YMB · Short stories, big emotions" />
<meta property="og:description" content="Discover the best short dramas and new episodes every day." /> <meta property="og:description" content="Discover the best short dramas and new episodes every day." />
<meta property="og:image" content="https://ymb.example.com/assets/hero.jpg" /> <meta property="og:image" content="%VITE_SITE_URL%/assets/hero.jpg" />
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebSite","name":"YMB","url":"https://ymb.example.com/","potentialAction":{"@type":"SearchAction","target":"https://ymb.example.com/?q={search_term_string}","query-input":"required name=search_term_string"}}</script> <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebSite","name":"YMB","url":"%VITE_SITE_URL%/","potentialAction":{"@type":"SearchAction","target":"%VITE_SITE_URL%/?q={search_term_string}","query-input":"required name=search_term_string"}}</script>
<title>YMB · Short stories, big emotions</title> <title>YMB · Short stories, big emotions</title>
</head> </head>
<body><div id="root"></div><script type="module" src="/src/main.jsx"></script></body> <body><div id="root"></div><script type="module" src="/src/main.jsx"></script></body>
+4
View File
@@ -0,0 +1,4 @@
/assets/*
Cache-Control: public, max-age=31536000, immutable
/index.html
Cache-Control: public, max-age=0, must-revalidate
+1
View File
@@ -0,0 +1 @@
/* /index.html 200
+2 -1
View File
@@ -1,4 +1,5 @@
# Author: fruit.com.cn # Author: fruit.com.cn
# __SITE_URL__ 由 vite.config.js 在构建时替换为 .env 的 VITE_SITE_URL
User-agent: * User-agent: *
Allow: / Allow: /
Sitemap: https://ymb.example.com/sitemap.xml Sitemap: __SITE_URL__/sitemap.xml
+6 -4
View File
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Author: fruit.com.cn --> <!-- Author: fruit.com.cn -->
<!-- __SITE_URL__ 由 vite.config.js 在构建时替换为 .env 的 VITE_SITE_URL -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>http://39.162.50.99:3007/</loc><changefreq>daily</changefreq><priority>1.0</priority></url> <url><loc>__SITE_URL__/</loc><changefreq>daily</changefreq><priority>1.0</priority></url>
<url><loc>http://39.162.50.99:3007/about</loc><changefreq>monthly</changefreq><priority>0.8</priority></url> <url><loc>__SITE_URL__/about</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
<url><loc>http://39.162.50.99:3007/privacy</loc><changefreq>yearly</changefreq><priority>0.5</priority></url> <url><loc>__SITE_URL__/contact</loc><changefreq>monthly</changefreq><priority>0.6</priority></url>
<url><loc>http://39.162.50.99:3007/terms</loc><changefreq>yearly</changefreq><priority>0.5</priority></url> <url><loc>__SITE_URL__/privacy</loc><changefreq>yearly</changefreq><priority>0.5</priority></url>
<url><loc>__SITE_URL__/terms</loc><changefreq>yearly</changefreq><priority>0.5</priority></url>
</urlset> </urlset>
+2
View File
@@ -10,6 +10,7 @@ const SearchPage = lazy(() => import('../features/search/SearchPage').then((modu
const HistoryPage = lazy(() => import('../features/history/HistoryPage').then((module) => ({ default: module.HistoryPage }))); const HistoryPage = lazy(() => import('../features/history/HistoryPage').then((module) => ({ default: module.HistoryPage })));
const ListingPage = lazy(() => import('../features/listing/ListingPage').then((module) => ({ default: module.ListingPage }))); const ListingPage = lazy(() => import('../features/listing/ListingPage').then((module) => ({ default: module.ListingPage })));
const AboutPage = lazy(() => import('../features/about/AboutPage').then((module) => ({ default: module.AboutPage }))); const AboutPage = lazy(() => import('../features/about/AboutPage').then((module) => ({ default: module.AboutPage })));
const ContactPage = lazy(() => import('../features/about/ContactPage').then((module) => ({ default: module.ContactPage })));
const LegalPage = lazy(() => import('../features/legal/LegalPage').then((module) => ({ default: module.LegalPage }))); const LegalPage = lazy(() => import('../features/legal/LegalPage').then((module) => ({ default: module.LegalPage })));
export function AppRouter() { export function AppRouter() {
@@ -22,6 +23,7 @@ export function AppRouter() {
<Route path="/library" element={<ListingPage type="library" />} /> <Route path="/library" element={<ListingPage type="library" />} />
<Route path="/history" element={<HistoryPage />} /> <Route path="/history" element={<HistoryPage />} />
<Route path="/about" element={<AboutPage />} /> <Route path="/about" element={<AboutPage />} />
<Route path="/contact" element={<ContactPage />} />
<Route path="/privacy" element={<LegalPage type="privacy" />} /> <Route path="/privacy" element={<LegalPage type="privacy" />} />
<Route path="/privacy-policy" element={<LegalPage type="privacy" />} /> <Route path="/privacy-policy" element={<LegalPage type="privacy" />} />
<Route path="/terms" element={<LegalPage type="terms" />} /> <Route path="/terms" element={<LegalPage type="terms" />} />
+70
View File
@@ -0,0 +1,70 @@
// Author: fruit.com.cn
import { useEffect } from 'react';
import { useLocale } from '../../app/providers/AppProviders';
import { COMPANY } from '../../shared/data/company';
/** 联系我们:邓白氏审核会找联系页,必须出现法定名称、注册地址、电话、邮箱。 */
const CONTACT_COPY = {
id: {
title: 'Hubungi Kami',
summary: 'Informasi kontak resmi perusahaan. Kami biasanya membalas dalam 1–2 hari kerja.',
companyTitle: 'Entitas Perusahaan',
contactTitle: 'Kontak',
emailLabel: 'Email',
phoneLabel: 'Telepon',
nibLabel: 'NIB',
addressLabel: 'Alamat Terdaftar',
},
en: {
title: 'Contact Us',
summary: 'Official company contact details. We usually reply within 1–2 business days.',
companyTitle: 'Company Entity',
contactTitle: 'Contact',
emailLabel: 'Email',
phoneLabel: 'Phone',
nibLabel: 'NIB',
addressLabel: 'Registered Address',
},
zh: {
title: '联系我们',
summary: '公司官方联系方式,通常在 1–2 个工作日内回复。',
companyTitle: '公司主体',
contactTitle: '联系方式',
emailLabel: '邮箱',
phoneLabel: '电话',
nibLabel: 'NIB 注册号',
addressLabel: '注册地址',
},
};
export function ContactPage() {
const { locale } = useLocale();
const copy = CONTACT_COPY[locale.code] || CONTACT_COPY.en;
useEffect(() => {
document.title = `${copy.title} · ${COMPANY.legalName}`;
}, [copy.title]);
return (
<article className="legal-page">
<header className="legal-header">
<span className="legal-kicker">{COMPANY.legalName}</span>
<h1>{copy.title}</h1>
<p className="legal-summary">{copy.summary}</p>
</header>
<div className="legal-body">
<section className="legal-section">
<h2>{copy.companyTitle}</h2>
<p><strong>{COMPANY.legalName}</strong></p>
<p>{copy.addressLabel}: {COMPANY.address}</p>
<p>{copy.nibLabel}: {COMPANY.nib}</p>
</section>
<section className="legal-section">
<h2>{copy.contactTitle}</h2>
<p>{copy.emailLabel}: <a href={`mailto:${COMPANY.email}`}>{COMPANY.email}</a></p>
<p>{copy.phoneLabel}: <a href={`tel:${COMPANY.phoneHref}`}>{COMPANY.phone}</a></p>
</section>
</div>
</article>
);
}
+4
View File
@@ -35,6 +35,10 @@
.legal-contact { margin-top: 22px; padding: 30px 44px; border-radius: 22px; background: #171a22; } .legal-contact { margin-top: 22px; padding: 30px 44px; border-radius: 22px; background: #171a22; }
.legal-contact p { margin: 8px 0; overflow-wrap: anywhere; } .legal-contact p { margin: 8px 0; overflow-wrap: anywhere; }
.legal-contact a { color: #a9ccff; } .legal-contact a { color: #a9ccff; }
.site-footer-company { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: #8b93a1; line-height: 1.7; }
.site-footer-company strong { color: #d7dbe2; font-size: 13px; }
.site-footer-company a { color: #8b93a1; }
.site-footer-company a:hover { color: #fff; text-decoration: underline; }
.site-footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; } .site-footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.site-footer-links a { color: #a0a0a0; } .site-footer-links a { color: #a0a0a0; }
.site-footer-links a:hover { color: #fff; text-decoration: underline; } .site-footer-links a:hover { color: #fff; text-decoration: underline; }
+3 -3
View File
@@ -1,7 +1,7 @@
// Author: fruit.com.cn // Author: fruit.com.cn
export const locales = { export const locales = {
id: { code: 'id', htmlLang: 'id', title: 'YMB · Cerita pendek, emosi besar', description: 'Temukan drama pendek terbaik dan episode baru setiap hari.', search: 'Cari drama, aktor, atau genre', searchResults: 'Hasil pencarian untuk', noResults: 'Tidak ada hasil untuk', clearSearch: 'Hapus pencarian', create: 'Buat', notifications: 'Notifikasi', account: 'Akun', home: 'Beranda', shorts: 'Shorts', subscriptions: 'Langganan', library: 'Perpustakaan', history: 'Riwayat', clearHistory: 'Hapus semua', historyEmpty: 'Belum ada riwayat tontonan.', comments: 'Komentar', noComments: 'Belum ada komentar.', commentPlaceholder: 'Tambah komentar…', send: 'Kirim', share: 'Bagikan', save: 'Simpan', like: 'Suka', linkCopied: 'Tautan disalin', subscribe: 'Subscribe', subscribed: 'Subscribed', uploadVideo: 'Unggah video', uploadHint: 'Seret file video ke sini, atau klik untuk memilih', uploadHintSub: 'MP4, MOV atau WebM', uploadTitleLabel: 'Judul', uploadTitlePlaceholder: 'Beri judul untuk videomu', uploadCancel: 'Batal', uploadSubmit: 'Unggah', uploadSuccessTitle: 'Video dikirim untuk ditinjau', uploadSuccessText: 'Setelah disetujui, video akan tampil di channel-mu.', uploadDone: 'Selesai', close: 'Tutup', episodes: 'Episode', episodeSwipeHint: 'Geser atas/bawah untuk ganti episode', lockedEpisode: 'Masuk untuk membuka episode ini.', soundHint: 'Ketuk untuk suara', about: 'Tentang YMB', copyright: 'YMB · Your Mini Business. Hak cipta dilindungi.', you: 'Anda', playlists: 'Playlist', watchLater: 'Tonton nanti', likedVideos: 'Video yang disukai', myVideos: 'Video saya', explore: 'Jelajahi', music: 'Musik', movies: 'Film', live: 'Live', more: 'Lainnya', liked: 'Drama disukai', hero: 'Cerita pendek,', accent: 'emosi besar.', watch: 'Mulai menonton', picks: 'Drama pilihan minggu ini', shortTitle: 'Shorts', viewAll: 'Lihat semua →', videoCount: 'video', channels: 'Ikuti cerita favoritmu', genres: ['Semua', 'Romansa', 'Balas dendam', 'Keluarga', 'Rahasia', 'Kisah kedua'], follow: 'Ikuti', following: 'Mengikuti', empty: 'Belum ada drama yang cocok.', loading: 'Memuat dari server…', apiFallback: 'Server belum tersedia, menampilkan katalog demo sementara.', playbackUnavailable: 'Pilih episode untuk mulai menonton.', swipeHint: 'Geser ke atas untuk menemukan cerita berikutnya' }, id: { code: 'id', htmlLang: 'id', title: 'YMB · Cerita pendek, emosi besar', description: 'Temukan drama pendek terbaik dan episode baru setiap hari.', search: 'Cari drama, aktor, atau genre', searchResults: 'Hasil pencarian untuk', noResults: 'Tidak ada hasil untuk', clearSearch: 'Hapus pencarian', create: 'Buat', notifications: 'Notifikasi', account: 'Akun', home: 'Beranda', shorts: 'Shorts', subscriptions: 'Langganan', library: 'Perpustakaan', history: 'Riwayat', clearHistory: 'Hapus semua', historyEmpty: 'Belum ada riwayat tontonan.', comments: 'Komentar', noComments: 'Belum ada komentar.', commentPlaceholder: 'Tambah komentar…', send: 'Kirim', share: 'Bagikan', save: 'Simpan', like: 'Suka', linkCopied: 'Tautan disalin', subscribe: 'Subscribe', subscribed: 'Subscribed', uploadVideo: 'Unggah video', uploadHint: 'Seret file video ke sini, atau klik untuk memilih', uploadHintSub: 'MP4, MOV atau WebM', uploadTitleLabel: 'Judul', uploadTitlePlaceholder: 'Beri judul untuk videomu', uploadCancel: 'Batal', uploadSubmit: 'Unggah', uploadSuccessTitle: 'Video dikirim untuk ditinjau', uploadSuccessText: 'Setelah disetujui, video akan tampil di channel-mu.', uploadDone: 'Selesai', close: 'Tutup', episodes: 'Episode', episodeSwipeHint: 'Geser atas/bawah untuk ganti episode', lockedEpisode: 'Masuk untuk membuka episode ini.', soundHint: 'Ketuk untuk suara', about: 'Tentang YMB', copyright: 'Hak cipta dilindungi.', you: 'Anda', playlists: 'Playlist', watchLater: 'Tonton nanti', likedVideos: 'Video yang disukai', myVideos: 'Video saya', explore: 'Jelajahi', music: 'Musik', movies: 'Film', live: 'Live', more: 'Lainnya', liked: 'Drama disukai', hero: 'Cerita pendek,', accent: 'emosi besar.', watch: 'Mulai menonton', picks: 'Drama pilihan minggu ini', shortTitle: 'Shorts', viewAll: 'Lihat semua →', videoCount: 'video', channels: 'Ikuti cerita favoritmu', genres: ['Semua', 'Romansa', 'Balas dendam', 'Keluarga', 'Rahasia', 'Kisah kedua'], follow: 'Ikuti', following: 'Mengikuti', empty: 'Belum ada drama yang cocok.', loading: 'Memuat dari server…', apiFallback: 'Server belum tersedia, menampilkan katalog demo sementara.', playbackUnavailable: 'Pilih episode untuk mulai menonton.', swipeHint: 'Geser ke atas untuk menemukan cerita berikutnya' },
en: { code: 'en', htmlLang: 'en', title: 'YMB · Short stories, big emotions', description: 'Discover the best short dramas and new episodes every day.', search: 'Search dramas, actors, or genres', searchResults: 'Search results for', noResults: 'No results for', clearSearch: 'Clear search', create: 'Create', notifications: 'Notifications', account: 'Account', home: 'Home', shorts: 'Shorts', subscriptions: 'Subscriptions', library: 'Library', history: 'History', clearHistory: 'Clear all', historyEmpty: 'No watch history yet.', comments: 'Comments', noComments: 'No comments yet.', commentPlaceholder: 'Add a comment…', send: 'Send', share: 'Share', save: 'Save', like: 'Like', linkCopied: 'Link copied', subscribe: 'Subscribe', subscribed: 'Subscribed', uploadVideo: 'Upload video', uploadHint: 'Drag and drop a video file here, or click to browse', uploadHintSub: 'MP4, MOV or WebM', uploadTitleLabel: 'Title', uploadTitlePlaceholder: 'Give your video a title', uploadCancel: 'Cancel', uploadSubmit: 'Upload', uploadSuccessTitle: 'Video submitted for review', uploadSuccessText: 'Once approved, it will appear on your channel.', uploadDone: 'Done', close: 'Close', episodes: 'Episodes', episodeSwipeHint: 'Swipe up/down to change episodes', lockedEpisode: 'Login to unlock this episode.', soundHint: 'Tap for sound', about: 'About YMB', copyright: 'YMB · Your Mini Business. All rights reserved.', you: 'You', playlists: 'Playlists', watchLater: 'Watch later', likedVideos: 'Liked videos', myVideos: 'Your videos', explore: 'Explore', music: 'Music', movies: 'Movies', live: 'Live', more: 'Show more', liked: 'Liked dramas', hero: 'Short stories,', accent: 'big emotions.', watch: 'Watch now', picks: 'Drama picks this week', shortTitle: 'Shorts', viewAll: 'View all →', videoCount: 'videos', channels: 'Follow your favorite stories', genres: ['All', 'Romance', 'Revenge', 'Family', 'Secrets', 'Second chance'], follow: 'Follow', following: 'Following', empty: 'No dramas match your search.', loading: 'Loading from server…', apiFallback: 'Server unavailable, showing the demo catalog temporarily.', playbackUnavailable: 'Select an episode to start watching.', swipeHint: 'Swipe up to discover the next story' }, en: { code: 'en', htmlLang: 'en', title: 'YMB · Short stories, big emotions', description: 'Discover the best short dramas and new episodes every day.', search: 'Search dramas, actors, or genres', searchResults: 'Search results for', noResults: 'No results for', clearSearch: 'Clear search', create: 'Create', notifications: 'Notifications', account: 'Account', home: 'Home', shorts: 'Shorts', subscriptions: 'Subscriptions', library: 'Library', history: 'History', clearHistory: 'Clear all', historyEmpty: 'No watch history yet.', comments: 'Comments', noComments: 'No comments yet.', commentPlaceholder: 'Add a comment…', send: 'Send', share: 'Share', save: 'Save', like: 'Like', linkCopied: 'Link copied', subscribe: 'Subscribe', subscribed: 'Subscribed', uploadVideo: 'Upload video', uploadHint: 'Drag and drop a video file here, or click to browse', uploadHintSub: 'MP4, MOV or WebM', uploadTitleLabel: 'Title', uploadTitlePlaceholder: 'Give your video a title', uploadCancel: 'Cancel', uploadSubmit: 'Upload', uploadSuccessTitle: 'Video submitted for review', uploadSuccessText: 'Once approved, it will appear on your channel.', uploadDone: 'Done', close: 'Close', episodes: 'Episodes', episodeSwipeHint: 'Swipe up/down to change episodes', lockedEpisode: 'Login to unlock this episode.', soundHint: 'Tap for sound', about: 'About YMB', copyright: 'All rights reserved.', you: 'You', playlists: 'Playlists', watchLater: 'Watch later', likedVideos: 'Liked videos', myVideos: 'Your videos', explore: 'Explore', music: 'Music', movies: 'Movies', live: 'Live', more: 'Show more', liked: 'Liked dramas', hero: 'Short stories,', accent: 'big emotions.', watch: 'Watch now', picks: 'Drama picks this week', shortTitle: 'Shorts', viewAll: 'View all →', videoCount: 'videos', channels: 'Follow your favorite stories', genres: ['All', 'Romance', 'Revenge', 'Family', 'Secrets', 'Second chance'], follow: 'Follow', following: 'Following', empty: 'No dramas match your search.', loading: 'Loading from server…', apiFallback: 'Server unavailable, showing the demo catalog temporarily.', playbackUnavailable: 'Select an episode to start watching.', swipeHint: 'Swipe up to discover the next story' },
zh: { code: 'zh', htmlLang: 'zh-CN', title: 'YMB · 短故事,大情绪', description: '发现精彩短剧,每天更新新剧集。', search: '搜索短剧、演员或题材', searchResults: '搜索结果', noResults: '没有找到相关结果', clearSearch: '清空搜索', create: '创建', notifications: '通知', account: '账号菜单', home: '首页', shorts: 'Shorts', subscriptions: '订阅', library: '媒体库', history: '观看记录', clearHistory: '清空记录', historyEmpty: '还没有观看记录。', comments: '评论', noComments: '还没有评论。', commentPlaceholder: '添加评论…', send: '发送', share: '分享', save: '收藏', like: '点赞', linkCopied: '链接已复制', subscribe: '订阅', subscribed: '已订阅', uploadVideo: '上传视频', uploadHint: '拖拽视频文件到此处,或点击选择', uploadHintSub: '支持 MP4 / MOV / WebM', uploadTitleLabel: '标题', uploadTitlePlaceholder: '为视频添加标题', uploadCancel: '取消', uploadSubmit: '上传', uploadSuccessTitle: '视频已提交审核', uploadSuccessText: '审核通过后会在你的频道中展示。', uploadDone: '完成', close: '关闭', episodes: '剧集', episodeSwipeHint: '上下滑动切换剧集', lockedEpisode: '登录后解锁本集。', soundHint: '点击开启声音', about: '关于 YMB', copyright: 'YMB · Your Mini Business. 版权所有。', you: '我', playlists: '播放列表', watchLater: '稍后观看', likedVideos: '赞过的视频', myVideos: '我的视频', explore: '探索', music: '音乐', movies: '电影', live: '直播', more: '展开', liked: '喜欢的短剧', hero: '短故事,', accent: '大情绪。', watch: '立即观看', picks: '本周精选短剧', shortTitle: 'Shorts', viewAll: '查看全部 →', videoCount: '个视频', channels: '关注你喜欢的故事', genres: ['全部', '爱情', '复仇', '家庭', '秘密', '重生'], follow: '关注', following: '已关注', empty: '没有找到匹配的短剧。', loading: '正在从服务端加载…', apiFallback: '服务端暂不可用,暂时展示演示目录。', playbackUnavailable: '请选择剧集开始播放。', swipeHint: '向上滑动发现下一个故事' } zh: { code: 'zh', htmlLang: 'zh-CN', title: 'YMB · 短故事,大情绪', description: '发现精彩短剧,每天更新新剧集。', search: '搜索短剧、演员或题材', searchResults: '搜索结果', noResults: '没有找到相关结果', clearSearch: '清空搜索', create: '创建', notifications: '通知', account: '账号菜单', home: '首页', shorts: 'Shorts', subscriptions: '订阅', library: '媒体库', history: '观看记录', clearHistory: '清空记录', historyEmpty: '还没有观看记录。', comments: '评论', noComments: '还没有评论。', commentPlaceholder: '添加评论…', send: '发送', share: '分享', save: '收藏', like: '点赞', linkCopied: '链接已复制', subscribe: '订阅', subscribed: '已订阅', uploadVideo: '上传视频', uploadHint: '拖拽视频文件到此处,或点击选择', uploadHintSub: '支持 MP4 / MOV / WebM', uploadTitleLabel: '标题', uploadTitlePlaceholder: '为视频添加标题', uploadCancel: '取消', uploadSubmit: '上传', uploadSuccessTitle: '视频已提交审核', uploadSuccessText: '审核通过后会在你的频道中展示。', uploadDone: '完成', close: '关闭', episodes: '剧集', episodeSwipeHint: '上下滑动切换剧集', lockedEpisode: '登录后解锁本集。', soundHint: '点击开启声音', about: '关于 YMB', copyright: '版权所有。', you: '我', playlists: '播放列表', watchLater: '稍后观看', likedVideos: '赞过的视频', myVideos: '我的视频', explore: '探索', music: '音乐', movies: '电影', live: '直播', more: '展开', liked: '喜欢的短剧', hero: '短故事,', accent: '大情绪。', watch: '立即观看', picks: '本周精选短剧', shortTitle: 'Shorts', viewAll: '查看全部 →', videoCount: '个视频', channels: '关注你喜欢的故事', genres: ['全部', '爱情', '复仇', '家庭', '秘密', '重生'], follow: '关注', following: '已关注', empty: '没有找到匹配的短剧。', loading: '正在从服务端加载…', apiFallback: '服务端暂不可用,暂时展示演示目录。', playbackUnavailable: '请选择剧集开始播放。', swipeHint: '向上滑动发现下一个故事' }
}; };
export function getLocale(code) { return locales[code] || locales.id; } export function getLocale(code) { return locales[code] || locales.id; }
+14 -1
View File
@@ -2,6 +2,7 @@
import { Suspense, useState } from 'react'; import { Suspense, useState } from 'react';
import { Link, Outlet, useLocation } from 'react-router-dom'; import { Link, Outlet, useLocation } from 'react-router-dom';
import { useLocale, useUi } from '../app/providers/AppProviders'; import { useLocale, useUi } from '../app/providers/AppProviders';
import { COMPANY } from '../shared/data/company';
import { Sidebar } from './components/Sidebar'; import { Sidebar } from './components/Sidebar';
import { TopBar } from './components/TopBar'; import { TopBar } from './components/TopBar';
import { UploadVideoDialog } from './components/UploadVideoDialog'; import { UploadVideoDialog } from './components/UploadVideoDialog';
@@ -30,13 +31,25 @@ export function AppShell() {
</Suspense> </Suspense>
{!immersive && ( {!immersive && (
<footer className="site-footer"> <footer className="site-footer">
<div>© {new Date().getFullYear()} {locale.copyright}</div> <div className="site-footer-company">
<strong>{COMPANY.legalName}</strong>
<span>{COMPANY.address}</span>
<span>
<a href={`tel:${COMPANY.phoneHref}`}>{COMPANY.phone}</a>
{' · '}
<a href={`mailto:${COMPANY.email}`}>{COMPANY.email}</a>
</span>
<span>NIB {COMPANY.nib}</span>
</div>
<div>© {new Date().getFullYear()} {COMPANY.legalName}. {locale.copyright}</div>
<nav className="site-footer-links" aria-label="Legal and company information"> <nav className="site-footer-links" aria-label="Legal and company information">
<Link to="/privacy">{links.privacy}</Link> <Link to="/privacy">{links.privacy}</Link>
<span aria-hidden="true">·</span> <span aria-hidden="true">·</span>
<Link to="/terms">{links.terms}</Link> <Link to="/terms">{links.terms}</Link>
<span aria-hidden="true">·</span> <span aria-hidden="true">·</span>
<Link to="/about">{links.about}</Link> <Link to="/about">{links.about}</Link>
<span aria-hidden="true">·</span>
<Link to="/contact">Contact</Link>
</nav> </nav>
</footer> </footer>
)} )}
+5 -1
View File
@@ -1,9 +1,13 @@
// Author: fruit.com.cn // Author: fruit.com.cn
// 主体信息:与印尼公司注册文件、D-U-N-S 档案、Apple 开发者账号保持逐字一致。
// 邮箱域名在 .env 的 VITE_CONTACT_EMAIL 中配置,买好域名后只改那一处。
export const COMPANY = { export const COMPANY = {
legalName: 'PT YMB TECHNOLOGY INDONESIA', legalName: 'PT YMB TECHNOLOGY INDONESIA',
address: 'Komplek Ruko Mega Grosir Cempaka Mas Blok C No. 6, Jakarta Pusat 10640, Indonesia', address: 'Komplek Ruko Mega Grosir Cempaka Mas Blok C No. 6, Jakarta Pusat 10640, Indonesia',
phone: '+62 821 7000 5974', phone: '+62 821 7000 5974',
phoneHref: '+6282170005974', phoneHref: '+6282170005974',
email: 'ymbtechnologyindonesia@gmail.com', email: import.meta.env.VITE_CONTACT_EMAIL || 'ymbtechnologyindonesia@gmail.com',
nib: '1240000631056', nib: '1240000631056',
country: 'Indonesia',
established: '2024',
}; };
+3 -1
View File
@@ -1,7 +1,9 @@
// Author: fruit.com.cn // Author: fruit.com.cn
const SITE_URL = (import.meta.env.VITE_SITE_URL || 'https://frostgiant.vip').replace(/\/$/, '');
export function applySeo(locale, route = '') { export function applySeo(locale, route = '') {
document.title = locale.title; document.title = locale.title;
document.documentElement.lang = locale.htmlLang; document.documentElement.lang = locale.htmlLang;
document.querySelector('meta[name="description"]')?.setAttribute('content', locale.description); document.querySelector('meta[name="description"]')?.setAttribute('content', locale.description);
document.querySelector('link[rel="canonical"]')?.setAttribute('href', `https://ymb.example.com${route || '/'}`); document.querySelector('link[rel="canonical"]')?.setAttribute('href', `${SITE_URL}${route || '/'}`);
} }
+25 -2
View File
@@ -1,5 +1,28 @@
// Author: fruit.com.cn // Author: fruit.com.cn
import { defineConfig } from 'vite'; import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
import { readFileSync, writeFileSync } from 'node:fs';
import { resolve } from 'node:path';
export default defineConfig({ plugins: [react()], server: { proxy: { '/app': { target: 'http://127.0.0.1:8081', changeOrigin: true }, '/files': { target: 'http://127.0.0.1:8081', changeOrigin: true } } } }); /** 把 public 里的 __SITE_URL__ 占位符替换成 .env 的 VITE_SITE_URL,域名只改一处。 */
function siteUrlPlugin() {
return {
name: 'site-url-replace',
apply: 'build',
closeBundle() {
const env = loadEnv('production', process.cwd(), '');
const url = (env.VITE_SITE_URL || '').replace(/\/$/, '');
if (!url) return;
for (const file of ['sitemap.xml', 'robots.txt']) {
const path = resolve('dist', file);
try {
writeFileSync(path, readFileSync(path, 'utf8').replaceAll('__SITE_URL__', url));
} catch {
// 文件不存在时忽略
}
}
},
};
}
export default defineConfig({ plugins: [react(), siteUrlPlugin()], server: { proxy: { '/app': { target: 'http://127.0.0.1:8081', changeOrigin: true }, '/files': { target: 'http://127.0.0.1:8081', changeOrigin: true } } } });