import React, { useEffect } from 'react'; import { Grid, Header, Placeholder, Segment } from 'semantic-ui-react'; import { API, showError, showNotice } from '../../helpers'; const Home = () => { const displayNotice = async () => { const res = await API.get('/api/notice'); const { success, message, data } = res.data; if (success) { let oldNotice = localStorage.getItem('notice'); if (data !== oldNotice && data !== '') { showNotice(data); localStorage.setItem('notice', data); } } else { showError(message); } }; useEffect(() => { displayNotice().then(); }, []); return ( <>
示例标题
); }; export default Home;