更新服务条款页面内容
This commit is contained in:
@@ -32,7 +32,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/miningAccount/index.vue'),
|
||||
meta: {title: '挖矿账户页面',
|
||||
description:i18n.t(`seo.miningAccount`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool mining account, crypto mining stats, mining rewards, hashrate monitor, 矿池账户, 挖矿收益, 算力监控'
|
||||
keywords:{
|
||||
en: 'M2Pool mining account, crypto mining stats, mining rewards, hashrate monitor, 矿池账户, 挖矿收益, 算力监控',
|
||||
@@ -63,7 +63,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/reportBlock/index.vue'),
|
||||
meta: {title: '报块页面',
|
||||
description:i18n.t(`seo.reportBlock`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,报块页面,幸运值,区块高度,Block page,Lucky Value,block height,Mining Pool'
|
||||
keywords:{
|
||||
en: 'Block page,Lucky Value,block height,Mining Pool',
|
||||
@@ -308,7 +308,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/submitWorkOrder/index.vue'),
|
||||
meta: {title: '提交工单页面',
|
||||
description:i18n.t(`seo.submitWorkOrder`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,提交工单,技术支持,问题处理,Mining Pool,Work Order Submission, Technical Support, Troubleshooting'
|
||||
keywords:{
|
||||
en: 'Mining Pool,Work Order Submission, Technical Support, Troubleshooting',
|
||||
@@ -322,7 +322,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/workOrderRecords/index.vue'),
|
||||
meta: {title: '工单记录页面(用户)',
|
||||
description:i18n.t(`seo.workOrderRecords`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,用户工单记录,处理状态,问题进度,User Work Order Records, Processing Status, Issue Progress'
|
||||
keywords:{
|
||||
en: 'User Work Order Records, Processing Status, Issue Progress',
|
||||
@@ -336,7 +336,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/userWorkDetails/index.vue'),
|
||||
meta: {title: '工单详情页面(用户)',
|
||||
description:i18n.t(`seo.userWorkDetails`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,用户工单详情,问题描述,补充提交,User Work Order Details, Problem Description, Additional Submissions'
|
||||
keywords:{
|
||||
en: 'User Work Order Details, Problem Description, Additional Submissions',
|
||||
@@ -408,7 +408,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/personalCenter/index.vue'),
|
||||
meta: {title: '个人中心页面',
|
||||
description:i18n.t(`seo.personalCenter`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,个人中心,挖矿账户,只读页面设置,安全设置,API密钥生成,Personal Center,Mining Account,Read-Only Page Setup,Security Settings,API Key Generation'
|
||||
keywords:{
|
||||
en: 'Personal Center,Mining Account,Read-Only Page Setup,Security Settings,API Key Generation',
|
||||
@@ -422,7 +422,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/personalCenter/personalMining/index.vue'),
|
||||
meta: {title: '挖矿账户设置页面',
|
||||
description:i18n.t(`seo.personalMining`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,个人中心,挖矿账户设置,币种账户,Personal Center,Mining Account Settings,Coin Accounts'
|
||||
keywords:{
|
||||
en: 'Personal Center,Mining Account Settings,Coin Accounts',
|
||||
@@ -436,7 +436,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/personalCenter/readOnly/index.vue'),
|
||||
meta: {title: '只读页面设置',
|
||||
description:i18n.t(`seo.readOnly`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,个人中心,只读页面设置,矿池分享,Personal Center,Read-Only Page Setting,Mining Pool Sharing'
|
||||
keywords:{
|
||||
en: 'Personal Center,Read-Only Page Setting,Mining Pool Sharing',
|
||||
@@ -450,7 +450,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/personalCenter/securitySetting/index.vue'),
|
||||
meta: {title: '安全设置页面',
|
||||
description:i18n.t(`seo.securitySetting`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,安全设置,密码修改,Security settings, password change'
|
||||
keywords:{
|
||||
en: 'Security settings, password change',
|
||||
@@ -464,7 +464,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/personalCenter/personal/index.vue'),
|
||||
meta: {title: '个人信息页面',
|
||||
description:i18n.t(`seo.personal`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,个人信息,登录历史,Personal Information, Login History'
|
||||
keywords:{
|
||||
en: 'Personal Information, Login History',
|
||||
@@ -478,7 +478,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/personalCenter/miningReport/index.vue'),
|
||||
meta: {title: '挖矿报告页面',
|
||||
description:i18n.t(`seo.miningReport`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,个人中心,挖矿报告,订阅服务,Mining Report, Subscription Service'
|
||||
keywords:{
|
||||
en: 'Mining Report, Subscription Service',
|
||||
@@ -493,7 +493,7 @@ const childrenRoutes = [
|
||||
component: () => import('../views/personalCenter/personalAPI/index.vue'),
|
||||
meta: {title: 'API页面',
|
||||
description:i18n.t(`seo.personalAPI`),
|
||||
allAuthority:[`admin`,`registered`],
|
||||
allAuthority:[`admin`,`registered`,`customer_service`],
|
||||
// keywords: 'M2Pool 矿池,个人中心,API 页面,API密钥生成,API Page,API Key Generation'
|
||||
keywords:{
|
||||
en: 'API Page,API Key Generation',
|
||||
@@ -634,87 +634,88 @@ const router = new VueRouter({
|
||||
|
||||
|
||||
|
||||
// router.beforeEach((to, from, next) => {
|
||||
// // 检查语言参数
|
||||
// const lang = to.params.lang;
|
||||
// const supportedLanguages = ['zh', 'en'];
|
||||
router.beforeEach((to, from, next) => {
|
||||
// 检查语言参数
|
||||
const lang = to.params.lang;
|
||||
const supportedLanguages = ['zh', 'en'];
|
||||
|
||||
// // 如果路径以斜杠结尾且不是根路径,则重定向
|
||||
// if (to.path.endsWith('/') && to.path.length > 1) {
|
||||
// const path = to.path.slice(0, -1);
|
||||
// return next({
|
||||
// path,
|
||||
// query: to.query,
|
||||
// hash: to.hash,
|
||||
// params: to.params
|
||||
// });
|
||||
// }
|
||||
// 如果路径以斜杠结尾且不是根路径,则重定向
|
||||
if (to.path.endsWith('/') && to.path.length > 1) {
|
||||
const path = to.path.slice(0, -1);
|
||||
return next({
|
||||
path,
|
||||
query: to.query,
|
||||
hash: to.hash,
|
||||
params: to.params
|
||||
});
|
||||
}
|
||||
|
||||
// if (!lang && to.path !== '/') {
|
||||
// const defaultLang = localStorage.getItem('lang') || 'en';
|
||||
// return next(`/${defaultLang}${to.path}`);
|
||||
// }
|
||||
if (!lang && to.path !== '/') {
|
||||
const defaultLang = localStorage.getItem('lang') || 'en';
|
||||
return next(`/${defaultLang}${to.path}`);
|
||||
}
|
||||
|
||||
// let data = localStorage.getItem("jurisdiction");
|
||||
// let jurisdiction =JSON.parse(data);
|
||||
let data = localStorage.getItem("jurisdiction");
|
||||
let jurisdiction =JSON.parse(data);
|
||||
console.log(jurisdiction,"权限");
|
||||
|
||||
// localStorage.setItem('superReportError',"")
|
||||
// let element = document.getElementsByClassName('el-main')[0];
|
||||
// if(element){
|
||||
// element.scrollTop = 0
|
||||
// }
|
||||
localStorage.setItem('superReportError',"")
|
||||
let element = document.getElementsByClassName('el-main')[0];
|
||||
if(element){
|
||||
element.scrollTop = 0
|
||||
}
|
||||
|
||||
// let token
|
||||
// try{
|
||||
// token =JSON.parse(localStorage.getItem('token'))
|
||||
// }catch(e){
|
||||
// console.log(e);
|
||||
// }
|
||||
let token
|
||||
try{
|
||||
token =JSON.parse(localStorage.getItem('token'))
|
||||
}catch(e){
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
|
||||
// if (token) {
|
||||
if (token) {
|
||||
|
||||
|
||||
// if (to.path === `/${lang}/login`|| to.path === `/${lang}/register`) {
|
||||
// next({ path: `/${lang}` })
|
||||
// }else if(to.meta.allAuthority && to.meta.allAuthority[0] ==`all`){
|
||||
// next()
|
||||
// }else if(jurisdiction.roleKey && to.meta.allAuthority&&to.meta.allAuthority.some(item=>item == jurisdiction.roleKey )){
|
||||
// next()
|
||||
// }else{
|
||||
// console.log(to.meta.allAuthority,to.path,"权限");
|
||||
if (to.path === `/${lang}/login`|| to.path === `/${lang}/register`) {
|
||||
next({ path: `/${lang}` })
|
||||
}else if(to.meta.allAuthority && to.meta.allAuthority[0] ==`all`){
|
||||
next()
|
||||
}else if(jurisdiction.roleKey && to.meta.allAuthority&&to.meta.allAuthority.some(item=>item == jurisdiction.roleKey )){
|
||||
next()
|
||||
}else{
|
||||
console.log(to.meta.allAuthority,to.path,"权限");
|
||||
|
||||
// Message({//权限不足
|
||||
// showClose: true,
|
||||
// message:i18n.t(`mining.jurisdiction`),
|
||||
// type: 'error'
|
||||
// });
|
||||
Message({//权限不足
|
||||
showClose: true,
|
||||
message:i18n.t(`mining.jurisdiction`),
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
// next({ path: `/${lang}` }) // 添加这行,重定向到首页
|
||||
// }
|
||||
next({ path: `/${lang}` }) // 添加这行,重定向到首页
|
||||
}
|
||||
|
||||
// }else{
|
||||
}else{
|
||||
|
||||
|
||||
// let paths = [`/${lang}/miningAccount`,`/${lang}/workOrderRecords`,`/${lang}/userWorkDetails`,`/${lang}/submitWorkOrder`,`/${lang}/workOrderBackend`,`/${lang}/BKWorkDetails`]
|
||||
// if (paths.includes(to.path) || to.path.includes(`personalCenter`) ) {
|
||||
let paths = [`/${lang}/miningAccount`,`/${lang}/workOrderRecords`,`/${lang}/userWorkDetails`,`/${lang}/submitWorkOrder`,`/${lang}/workOrderBackend`,`/${lang}/BKWorkDetails`]
|
||||
if (paths.includes(to.path) || to.path.includes(`personalCenter`) ) {
|
||||
|
||||
// Message({//权限不足
|
||||
// showClose: true,
|
||||
// message:i18n.t(`mining.logInFirst`),
|
||||
// type: 'error'
|
||||
// });
|
||||
Message({//权限不足
|
||||
showClose: true,
|
||||
message:i18n.t(`mining.logInFirst`),
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
// next({ path: `/${lang}/login` })
|
||||
// } else {
|
||||
next({ path: `/${lang}/login` })
|
||||
} else {
|
||||
|
||||
// next()
|
||||
// }
|
||||
// }
|
||||
next()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// })
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user