From af7307d704d565cfee569e62912dcc75d1bf2749 Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 24 Mar 2023 10:58:37 +0800 Subject: [PATCH 1/2] fix: admin guard render 403 --- ui/src/utils/guard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.ts index 280df4df..7c852986 100644 --- a/ui/src/utils/guard.ts +++ b/ui/src/utils/guard.ts @@ -174,7 +174,7 @@ export const admin = () => { const us = deriveLoginState(); if (gr.ok && !us.isAdmin) { gr.ok = false; - gr.redirect = RouteAlias.home; + gr.redirect = ''; } return gr; }; From ad142a38e56ea20bf3fb73d80b59497830585714 Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 24 Mar 2023 17:25:39 +0800 Subject: [PATCH 2/2] fix: rename page file --- ui/src/pages/404/{index.jsx => index.tsx} | 3 +-- ui/src/pages/50X/{index.jsx => index.tsx} | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) rename ui/src/pages/404/{index.jsx => index.tsx} (84%) rename ui/src/pages/50X/{index.jsx => index.tsx} (84%) diff --git a/ui/src/pages/404/index.jsx b/ui/src/pages/404/index.tsx similarity index 84% rename from ui/src/pages/404/index.jsx rename to ui/src/pages/404/index.tsx index 0f088abc..b14040e3 100644 --- a/ui/src/pages/404/index.jsx +++ b/ui/src/pages/404/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable import/no-unresolved */ import { useEffect } from 'react'; import { Container } from 'react-bootstrap'; @@ -7,7 +6,7 @@ import { HttpErrorContent } from '@/components'; const Index = () => { useEffect(() => { // auto height of container - const pageWrap = document.querySelector('.page-wrap'); + const pageWrap = document.querySelector('.page-wrap') as HTMLElement; pageWrap.style.display = 'contents'; return () => { diff --git a/ui/src/pages/50X/index.jsx b/ui/src/pages/50X/index.tsx similarity index 84% rename from ui/src/pages/50X/index.jsx rename to ui/src/pages/50X/index.tsx index fe142ad6..87017b30 100644 --- a/ui/src/pages/50X/index.jsx +++ b/ui/src/pages/50X/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable import/no-unresolved */ import { useEffect } from 'react'; import { Container } from 'react-bootstrap'; @@ -7,7 +6,7 @@ import { HttpErrorContent } from '@/components'; const Index = () => { useEffect(() => { // auto height of container - const pageWrap = document.querySelector('.page-wrap'); + const pageWrap = document.querySelector('.page-wrap') as HTMLElement; pageWrap.style.display = 'contents'; return () => {