feat: 增加验证
parent
020bba07f1
commit
58da4126c9
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue