UNPKG

qt-public-ui

Version:

新设计规范下业务组件库

28 lines 1.03 kB
import React from 'react'; import Page from '../../Page'; import { Page403, ErrorOpen, Error403 } from './errorPage'; export default (function (props) { var getContent = function getContent() { if (props.allAccessible) { return props.children; } if (props.noAccess) { return /*#__PURE__*/React.createElement(Error403, null); } if (location.pathname.match(/^\/platform\/.{24}\//) && !props.isFetching) { if (props.name) { if (location.pathname.indexOf(props.link) === -1 && props.pattern && !location.pathname.match(props.pattern)) return /*#__PURE__*/React.createElement(Page403, null); if (!props.opened) { return /*#__PURE__*/React.createElement(ErrorOpen, null); } else if (!props.accessible) { return /*#__PURE__*/React.createElement(Page403, null); } else { return props.children; } } } else { return props.children; } }; return /*#__PURE__*/React.createElement(Page, null, getContent()); });