feat: 路由403增加账号和权限提示

perf/export-docx
Jimmy Liow 1 year ago
parent 551b082168
commit 7801719522

@ -4,7 +4,7 @@ import useAuthStore from '@/stores/Auth'
export default function RequireAuth({ children, ...props }) {
const isPermitted = useAuthStore((state) => state.isPermitted)
const [isPermitted, currentUser] = useAuthStore(state => [state.isPermitted, state.currentUser])
const { userId } = usingStorage()
if (isPermitted(props.subject)) {
@ -15,7 +15,7 @@ export default function RequireAuth({ children, ...props }) {
<Result
status='403'
title='403'
subTitle={`抱歉,你(${userId})没有权限使用该功能`}
subTitle={`抱歉,你(${currentUser.username})没有权限使用该功能(${props.subject})`}
/>
)
}

Loading…
Cancel
Save