fix: preserve legacy activity routes
This commit is contained in:
parent
4493657bd7
commit
b0ebcb2675
2
.env
2
.env
@ -1,5 +1,5 @@
|
|||||||
# 应用版本号
|
# 应用版本号
|
||||||
VITE_APP_VERSION=7.0.59
|
VITE_APP_VERSION=7.0.60
|
||||||
|
|
||||||
# 版本类型
|
# 版本类型
|
||||||
# major:重大更新(清除除了白名单外的所有缓存:用户缓存、图片缓存和assets缓存)
|
# major:重大更新(清除除了白名单外的所有缓存:用户缓存、图片缓存和assets缓存)
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"page_not_found": "الصفحة غير موجودة",
|
||||||
|
"page_not_found_description": "رابط النشاط غير صالح أو انتهت صلاحيته.",
|
||||||
|
"close_page": "إغلاق",
|
||||||
"apply_join_team": "تقديم طلب للانضمام إلى الفريق",
|
"apply_join_team": "تقديم طلب للانضمام إلى الفريق",
|
||||||
"apply_reminder": "تذكير قبل التقديم:",
|
"apply_reminder": "تذكير قبل التقديم:",
|
||||||
"apply_reminder_detail": "أدخل معرف الوكلاء الخاص بك، وستصبح مضيفًا بعد موافقة طلب المضيف. بعد أن تصبح مضيفًا، سيتم تخصيص دخلك إلى وكيلك.",
|
"apply_reminder_detail": "أدخل معرف الوكلاء الخاص بك، وستصبح مضيفًا بعد موافقة طلب المضيف. بعد أن تصبح مضيفًا، سيتم تخصيص دخلك إلى وكيلك.",
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"page_not_found": "পৃষ্ঠা পাওয়া যায়নি",
|
||||||
|
"page_not_found_description": "এই কার্যকলাপের লিঙ্কটি অবৈধ বা মেয়াদ শেষ হয়ে গেছে।",
|
||||||
|
"close_page": "বন্ধ করুন",
|
||||||
"apply_join_team": "দলে যোগদানের জন্য আবেদন করুন",
|
"apply_join_team": "দলে যোগদানের জন্য আবেদন করুন",
|
||||||
"apply_reminder": "আবেদনের আগে সতর্কবার্তা:",
|
"apply_reminder": "আবেদনের আগে সতর্কবার্তা:",
|
||||||
"apply_reminder_detail": "আপনার এজেন্টের আইডি লিখুন, এবং হোস্ট আবেদন অনুমোদিত হওয়ার পরে আপনি হোস্ট হয়ে যাবেন। হোস্ট হওয়ার পরে, আপনার আয় আপনার এজেন্টের কাছে ন্যস্ত করা হবে।",
|
"apply_reminder_detail": "আপনার এজেন্টের আইডি লিখুন, এবং হোস্ট আবেদন অনুমোদিত হওয়ার পরে আপনি হোস্ট হয়ে যাবেন। হোস্ট হওয়ার পরে, আপনার আয় আপনার এজেন্টের কাছে ন্যস্ত করা হবে।",
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"page_not_found": "Page not found",
|
||||||
|
"page_not_found_description": "This activity link is invalid or has expired.",
|
||||||
|
"close_page": "Close",
|
||||||
"apply_join_team": "Apply to join the team",
|
"apply_join_team": "Apply to join the team",
|
||||||
"apply_reminder": "Reminder before application:",
|
"apply_reminder": "Reminder before application:",
|
||||||
"apply_reminder_detail": "Enter the lD of your agent, and you will become the host afterthe host apply is approved. After becoming an hoster,yourincome will be entrusted to your agent",
|
"apply_reminder_detail": "Enter the lD of your agent, and you will become the host afterthe host apply is approved. After becoming an hoster,yourincome will be entrusted to your agent",
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"page_not_found": "Sayfa bulunamadı",
|
||||||
|
"page_not_found_description": "Bu etkinlik bağlantısı geçersiz veya süresi dolmuş.",
|
||||||
|
"close_page": "Kapat",
|
||||||
"apply_join_team": "Takıma katılmak için başvur",
|
"apply_join_team": "Takıma katılmak için başvur",
|
||||||
"apply_reminder": "Başvurudan önce hatırlatma:",
|
"apply_reminder": "Başvurudan önce hatırlatma:",
|
||||||
"apply_reminder_detail": "Acentenizin ID'sini girin ve host başvurusu onaylandıktan sonra host olacaksınız. Host olduktan sonra, geliriniz acentenize emanet edilecektir.",
|
"apply_reminder_detail": "Acentenizin ID'sini girin ve host başvurusu onaylandıktan sonra host olacaksınız. Host olduktan sonra, geliriniz acentenize emanet edilecektir.",
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"page_not_found": "页面不存在",
|
||||||
|
"page_not_found_description": "该活动链接无效或已过期。",
|
||||||
|
"close_page": "关闭",
|
||||||
"apply_join_team": "申请加入团队",
|
"apply_join_team": "申请加入团队",
|
||||||
"apply_reminder": "申请前提醒",
|
"apply_reminder": "申请前提醒",
|
||||||
"apply_reminder_detail": "输入你的代理人的ID,在主持人申请获得批准后,你将成为主持人。成为主持人后,你的收入将委托给你的代理人。",
|
"apply_reminder_detail": "输入你的代理人的ID,在主持人申请获得批准后,你将成为主持人。成为主持人后,你的收入将委托给你的代理人。",
|
||||||
|
|||||||
@ -1,6 +1,13 @@
|
|||||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||||
import { installRouteGuard } from '../utils/routeGuard.js'
|
import { installRouteGuard } from '../utils/routeGuard.js'
|
||||||
|
|
||||||
|
// 固定活动存在多套线上历史地址;重定向时必须保留语言和 Banner 来源参数。
|
||||||
|
const redirectPreservingLocation = (path) => (to) => ({
|
||||||
|
path,
|
||||||
|
query: to.query,
|
||||||
|
hash: to.hash,
|
||||||
|
})
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(import.meta.env.BASE_URL),
|
history: createWebHashHistory(import.meta.env.BASE_URL),
|
||||||
routes: [
|
routes: [
|
||||||
@ -40,11 +47,39 @@ const router = createRouter({
|
|||||||
component: () => import('../views/PlatformPolicy/PlatformPolicy.vue'),
|
component: () => import('../views/PlatformPolicy/PlatformPolicy.vue'),
|
||||||
meta: { requiresAuth: true },
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/invitation-to-register',
|
||||||
|
name: 'legacy-invitation-to-register',
|
||||||
|
// 线上旧 Banner 仍会打开该地址,必须转到当前邀请活动。
|
||||||
|
redirect: redirectPreservingLocation('/invitation/invite-new-user'),
|
||||||
|
meta: { requiresAuth: false, isPublic: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/ranking/king-queen',
|
||||||
|
name: 'legacy-ranking-king-queen',
|
||||||
|
// 兼容 atu_prod 和线上 Banner 使用的新版 King and Queen 地址。
|
||||||
|
redirect: redirectPreservingLocation('/top-list'),
|
||||||
|
meta: { requiresAuth: false, isPublic: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/ranking/weekly-star',
|
||||||
|
name: 'legacy-ranking-weekly-star',
|
||||||
|
// 兼容 atu_prod 和线上 Banner 使用的新版 Weekly Star 地址。
|
||||||
|
redirect: redirectPreservingLocation('/weekly-star'),
|
||||||
|
meta: { requiresAuth: false, isPublic: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/404',
|
||||||
|
name: 'not-found-page',
|
||||||
|
component: () => import('../views/LandingPage/NotFoundView.vue'),
|
||||||
|
meta: { requiresAuth: false, isPublic: true },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/:pathMatch(.*)*',
|
path: '/:pathMatch(.*)*',
|
||||||
name: 'not-found',
|
name: 'not-found',
|
||||||
redirect: '/apply',
|
// 未知活动地址必须明确展示 404,不能伪装成公会/主播申请页。
|
||||||
}, // 404 页面
|
redirect: (to) => ({ path: '/404', query: { ...to.query, from: to.path } }),
|
||||||
|
},
|
||||||
|
|
||||||
// 管理员中心
|
// 管理员中心
|
||||||
{
|
{
|
||||||
|
|||||||
@ -38,7 +38,8 @@ export const PAGES = {
|
|||||||
|
|
||||||
// 邀请页面
|
// 邀请页面
|
||||||
const INVITATION_PAGES = {
|
const INVITATION_PAGES = {
|
||||||
INVITE_USER: '/invitation-to-register', //邀请新用户(邀请码)
|
INVITE_USER: '/invitation/invite-new-user', // 当前邀请新用户活动
|
||||||
|
LEGACY_INVITE_USER: '/invitation-to-register', // 兼容线上历史 Banner 地址
|
||||||
INVITE_RECHARGE_AGENCY: '/invite-recharge-agency', //邀请代理
|
INVITE_RECHARGE_AGENCY: '/invite-recharge-agency', //邀请代理
|
||||||
INVITE_AGENCY: '/invite-agency', //邀请代理
|
INVITE_AGENCY: '/invite-agency', //邀请代理
|
||||||
INVITE_BD: '/invite-bd', //邀请成为BD
|
INVITE_BD: '/invite-bd', //邀请成为BD
|
||||||
@ -56,8 +57,8 @@ const RANKING_PAGES = [
|
|||||||
|
|
||||||
// 活动页面
|
// 活动页面
|
||||||
const ACTIVITIES = [
|
const ACTIVITIES = [
|
||||||
INVITATION_PAGES.INVITE_USER, //邀请新用户(邀请码)
|
INVITATION_PAGES.INVITE_USER, //邀请新用户
|
||||||
'/invitation/invite-new-user', //邀请新用户
|
INVITATION_PAGES.LEGACY_INVITE_USER, //历史邀请入口,由路由重定向到当前活动
|
||||||
'/recharge-reward', //充值奖励
|
'/recharge-reward', //充值奖励
|
||||||
'/login-reward', // 登录奖励
|
'/login-reward', // 登录奖励
|
||||||
|
|
||||||
|
|||||||
67
src/views/LandingPage/NotFoundView.vue
Normal file
67
src/views/LandingPage/NotFoundView.vue
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<main class="not-found-page">
|
||||||
|
<section class="not-found-card">
|
||||||
|
<div class="status-code">404</div>
|
||||||
|
<h1>{{ t('page_not_found') }}</h1>
|
||||||
|
<p>{{ t('page_not_found_description') }}</p>
|
||||||
|
<button type="button" @click="closePage">{{ t('close_page') }}</button>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
import { closePage } from '@/utils/appBridge.js'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.not-found-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24px;
|
||||||
|
background: linear-gradient(180deg, #fff8ef 0%, #f6f1ff 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.not-found-card {
|
||||||
|
width: min(100%, 420px);
|
||||||
|
padding: 40px 24px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 16px 40px rgba(75, 49, 115, 0.12);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-code {
|
||||||
|
color: #8b5cf6;
|
||||||
|
font-size: 64px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-top: 20px;
|
||||||
|
color: #282334;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 12px;
|
||||||
|
color: #736c7f;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-top: 28px;
|
||||||
|
padding: 12px 28px;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: #8b5cf6;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user