部署生产定时任务
This commit is contained in:
@@ -470,41 +470,62 @@ const setViewsIncrease = (value: any) => {
|
||||
);
|
||||
};
|
||||
let upgradeList = ["/feedbackSurvey", "/feedbackSurveyCN", "emailVerify"]; //指定页面系统维护也可以访问
|
||||
function isTimeRangePassed(timeRange) {
|
||||
const [startStr, endStr] = timeRange.split(' - ');
|
||||
const startTime = new Date(startStr).getTime();
|
||||
const endTime = new Date(endStr).getTime();
|
||||
const currentTime = new Date().getTime();
|
||||
|
||||
if (currentTime < startTime) {
|
||||
return 'not_started'; // 未开始
|
||||
} else if (currentTime >= startTime && currentTime <= endTime) {
|
||||
return 'in_progress'; // 进行中
|
||||
} else {
|
||||
return 'ended'; // 已结束
|
||||
}
|
||||
}
|
||||
|
||||
router.beforeEach((to: any, from, next) => {
|
||||
// 系统维护
|
||||
// const toName = to.name === 'upgrade';
|
||||
// if(upgradeList.indexOf(to.path) > -1){
|
||||
// next();
|
||||
// }else{
|
||||
// if (toName) {
|
||||
// next();
|
||||
// } else {
|
||||
// next({ name: 'upgrade' });
|
||||
// }
|
||||
// }
|
||||
// return
|
||||
// 机房用户
|
||||
let herfData = window.location.search.substring(1);
|
||||
if (herfData.split("=")[0] == "noLogin" && to.name != "homePage") {
|
||||
setMurmur(herfData.split("=")[1]);
|
||||
return;
|
||||
}
|
||||
let affiliateRef = sessionStorage.getItem("affiliateRef");
|
||||
if (to.query.order) sessionStorage.setItem("orderId", to.query.order); //记录是否点击跳转订单链接
|
||||
if (to.query.ref && affiliateRef != to.query.ref)
|
||||
setViewsIncrease(to.query.ref);
|
||||
//系统维护时间
|
||||
const time = '2025-10-15T22:00:00 - 2025-10-15T23:00:00';
|
||||
if (isTimeRangePassed(time) == 'in_progress') {
|
||||
// 系统维护
|
||||
const toName = to.name === 'upgrade';
|
||||
if(upgradeList.indexOf(to.path) > -1){
|
||||
next();
|
||||
}else{
|
||||
if (toName) {
|
||||
next();
|
||||
} else {
|
||||
next({ name: 'upgrade' });
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// 机房用户
|
||||
let herfData = window.location.search.substring(1);
|
||||
if (herfData.split("=")[0] == "noLogin" && to.name != "homePage") {
|
||||
setMurmur(herfData.split("=")[1]);
|
||||
return;
|
||||
}
|
||||
let affiliateRef = sessionStorage.getItem("affiliateRef");
|
||||
if (to.query.order) sessionStorage.setItem("orderId", to.query.order); //记录是否点击跳转订单链接
|
||||
if (to.query.ref && affiliateRef != to.query.ref)
|
||||
setViewsIncrease(to.query.ref);
|
||||
|
||||
|
||||
var vuex_systemList: any = sessionStorage.getItem("vuex_systemList");
|
||||
if (to.meta.enter == "all") {
|
||||
next();
|
||||
} else if (
|
||||
(state.UserHabit?.userDetail?.systemList?.indexOf(to.meta.enter) > -1) || (vuex_systemList?.indexOf(to.meta.enter))
|
||||
) {
|
||||
next();
|
||||
} else {
|
||||
next("/404");
|
||||
}
|
||||
var vuex_systemList: any = sessionStorage.getItem("vuex_systemList");
|
||||
if (to.meta.enter == "all") {
|
||||
next();
|
||||
} else if (
|
||||
(state.UserHabit?.userDetail?.systemList?.indexOf(to.meta.enter) > -1) || (vuex_systemList?.indexOf(to.meta.enter))
|
||||
) {
|
||||
next();
|
||||
} else {
|
||||
next("/404");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if(systemUser == 0){//游客用户只能进入这两个页面
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user