feat: 增加验证

master
xjs 2025-05-26 09:31:37 +08:00
parent 020bba07f1
commit 58da4126c9
2 changed files with 1 additions and 3 deletions

View File

@ -29,13 +29,11 @@ router.beforeEach((to, _from, next) => {
const userStore = useUserStore()
let userRole = "";
let hasLogin = userStore.getAccessToken;
console.log(hasLogin);
// 如果目标路由没有角色限制
if (!to.meta.role) {
next();
}
console.log(to.meta.role);
// 判断当前用户角色是否在目标路由的允许角色列表中
if ((to.meta.role as string[]).includes(userRole)) {

View File

@ -23,7 +23,7 @@
</div>
<YProgress :percentage="Math.round(paymentData.chargeTotal/paymentData.estimatedTotal * 100)" height="12px" class="mt-[7px]" />
</div>
<div class="ml-[4px] relative">
<div class="ml-[4px] relative w-[143px] h-[143px]">
<ProportionCharts :chart-data="chartData" class="z-2 relative" />
<SvgComponent :content="paymentChartSvg" class="w-[143px] h-[143px] absolute top-0 left-0 z-1" />
<div