feat: 更新价格界面原型;所有海外供应商路由加上权证验证
parent
849e6ceef0
commit
bfc994cd12
Binary file not shown.
@ -1,19 +1,21 @@
|
|||||||
import { Result } from 'antd'
|
import { Result } from 'antd'
|
||||||
|
import { usingStorage } from '@/hooks/usingStorage'
|
||||||
import useAuthStore from '@/stores/Auth'
|
import useAuthStore from '@/stores/Auth'
|
||||||
|
|
||||||
export default function RequireAuth({ children, ...props }, ) {
|
export default function RequireAuth({ children, ...props }) {
|
||||||
|
|
||||||
const isPermitted = useAuthStore((state) => state.isPermitted)
|
const isPermitted = useAuthStore((state) => state.isPermitted)
|
||||||
|
const { userId } = usingStorage()
|
||||||
|
|
||||||
if (isPermitted(props.subject)) {
|
if (isPermitted(props.subject)) {
|
||||||
// if (props.subject === '/account/management') {
|
// if (props.subject === '/account/management1') {
|
||||||
return children
|
return children
|
||||||
} else if (props.result) {
|
} else if (props.result) {
|
||||||
return (
|
return (
|
||||||
<Result
|
<Result
|
||||||
status='403'
|
status='403'
|
||||||
title='403'
|
title='403'
|
||||||
subTitle={'抱歉,你没有权限使用该功能。'}
|
subTitle={`抱歉,你(${userId})没有权限使用该功能。`}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue