BUG fix: router i18n

This commit is contained in:
KUN1007 2023-10-16 22:33:35 +08:00
parent 5d4c47557b
commit 46f2f8df49
4 changed files with 24 additions and 8 deletions

View file

@ -278,6 +278,14 @@ export default {
},
// 路由标题
router: {
login: 'Login',
forget: 'Forgot Password',
contact: 'Contact Us',
donate: 'Donate Us',
agreement: 'User Agreement',
privacy: 'Privacy',
redirect: 'Redirect',
home: 'Home',
balance: 'P & L',
edit: 'Edit',

View file

@ -276,6 +276,14 @@ export default {
},
// 路由标题
router: {
login: '登录',
forget: '忘记密码',
contact: '联系我们',
donate: '赞助我们',
agreement: '用户协议',
privacy: '隐私政策',
redirect: '重定向',
home: '主页',
balance: '收支公示',
edit: '编辑',

View file

@ -7,7 +7,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/login',
component: () => import('@/views/login/Login.vue'),
meta: {
title: '登录',
title: 'login',
},
},
// KUNGalgame 忘记密码
@ -16,7 +16,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/forgot',
component: () => import('@/views/forgot/Forgot.vue'),
meta: {
title: '忘记密码',
title: 'forget',
},
},
// KUNGalgame 联系我们
@ -25,7 +25,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/contact',
component: () => import('@/views/contact/Contact.vue'),
meta: {
title: '联系我们',
title: 'contact',
},
},
@ -35,7 +35,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/donate',
component: () => import('@/views/donate/Donate.vue'),
meta: {
title: '赞助我们',
title: 'donate',
},
},
@ -45,7 +45,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/agreement',
component: () => import('@/views/agreement/Agreement.vue'),
meta: {
title: '用户协议',
title: 'agreement',
},
},
@ -55,7 +55,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/privacy',
component: () => import('@/views/privacy/Privacy.vue'),
meta: {
title: '隐私政策',
title: 'privacy',
},
},
@ -66,7 +66,7 @@ export const constantRoutes: RouteRecordRaw[] = [
redirect: '/',
component: () => import('@/views/redirect/Redirect.vue'),
meta: {
title: '重定向',
title: 'redirect',
},
children: [], // 添加一个空的 children 数组redirect 配置项必须有 children
},

View file

@ -1,7 +1,7 @@
// 正则表达式匹配合法 URL
export const isValidURL = (url: string) => {
const regex =
/^(https?|http):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
/^(https?|http):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|net|org|biz|moe|info|name|pro|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return regex.test(url)
}