From 105811d47e91941098556b6061280b0d6cb0ad22 Mon Sep 17 00:00:00 2001 From: shuai Date: Tue, 7 Mar 2023 16:29:13 +0800 Subject: [PATCH] fix: admin user role_id --- ui/src/pages/Questions/Detail/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/pages/Questions/Detail/index.tsx b/ui/src/pages/Questions/Detail/index.tsx index 91654e05..db3c8ebd 100644 --- a/ui/src/pages/Questions/Detail/index.tsx +++ b/ui/src/pages/Questions/Detail/index.tsx @@ -56,7 +56,7 @@ const Index = () => { const { setUsers } = usePageUsers(); const userInfo = loggedUserInfoStore((state) => state.user); const isAuthor = userInfo?.username === question?.user_info?.username; - const isAdmin = userInfo?.is_admin; + const isAdmin = userInfo?.role_id === 2; const isLogged = Boolean(userInfo?.access_token); const { state: locationState } = useLocation();