增加登录验证
This commit is contained in:
@ -333,7 +333,7 @@ const IndexPage: React.FC = () => {
|
|||||||
<div className="blockTitle">问题咨询方式</div>
|
<div className="blockTitle">问题咨询方式</div>
|
||||||
<div className="borderBox">
|
<div className="borderBox">
|
||||||
{/* addressImg */}
|
{/* addressImg */}
|
||||||
<img src={require('@/assets/img/location.png')} alt="" />
|
<img src={aboutUs.addressImg} alt="" />
|
||||||
<div className="questionItem">
|
<div className="questionItem">
|
||||||
<IconFont type="icon-dizhi" className="icon" />
|
<IconFont type="icon-dizhi" className="icon" />
|
||||||
{aboutUs[intl.formatMessage({ id: 'home.data.address' })]}
|
{aboutUs[intl.formatMessage({ id: 'home.data.address' })]}
|
||||||
@ -383,7 +383,7 @@ const IndexPage: React.FC = () => {
|
|||||||
<Card>
|
<Card>
|
||||||
{friendshipConnections.map((item, index) => (
|
{friendshipConnections.map((item, index) => (
|
||||||
<Card.Grid key={item.id} style={{ width: '16.6667%', height: '130px' }}>
|
<Card.Grid key={item.id} style={{ width: '16.6667%', height: '130px' }}>
|
||||||
<img src={item.url} alt="" />
|
<img src={item.thumbnail} alt="" />
|
||||||
</Card.Grid>
|
</Card.Grid>
|
||||||
))}
|
))}
|
||||||
</Card>
|
</Card>
|
||||||
|
13
src/wrappers/auth.tsx
Normal file
13
src/wrappers/auth.tsx
Normal file
@ -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 <div>{props.children}</div>;
|
||||||
|
} else {
|
||||||
|
// 提示后跳转
|
||||||
|
message.error('请先登录');
|
||||||
|
return <Redirect to="/login" />;
|
||||||
|
}
|
||||||
|
};
|
Reference in New Issue
Block a user