diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 72b87d0..c62d360 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -333,7 +333,7 @@ const IndexPage: React.FC = () => {
问题咨询方式
{/* addressImg */} - +
{aboutUs[intl.formatMessage({ id: 'home.data.address' })]} @@ -383,7 +383,7 @@ const IndexPage: React.FC = () => { {friendshipConnections.map((item, index) => ( - + ))} diff --git a/src/wrappers/auth.tsx b/src/wrappers/auth.tsx new file mode 100644 index 0000000..cd46ca5 --- /dev/null +++ b/src/wrappers/auth.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import { Redirect } from 'umi'; +import { message } from 'antd'; +// 权限校验 +export default (props: any) => { + if (localStorage.getItem('token')) { + return
{props.children}
; + } else { + // 提示后跳转 + message.error('请先登录'); + return ; + } +};