大图查看页面增加日历展示,支持显示节假日信息,提高实用性

This commit is contained in:
2026-01-28 20:22:55 +08:00
parent 617c1d0967
commit 8bc9b44a14
8 changed files with 804 additions and 26 deletions

View File

@@ -17,11 +17,20 @@ const router = createRouter({
}
},
{
path: '/image/:date',
path: '/image/:date?',
name: 'ImageView',
component: ImageView,
meta: {
title: '图片详情'
},
beforeEnter: (to, _from, next) => {
// 如果没有提供日期参数,重定向到今天的日期
if (!to.params.date) {
const today = new Date().toISOString().split('T')[0]
next({ path: `/image/${today}`, replace: true })
} else {
next()
}
}
},
{