From 6253dcceb51f0b28667d4e9e86cffe8bb3618c76 Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 28 Mar 2021 10:36:33 +0800 Subject: [PATCH] fix issue --- spug_web/src/pages/home/Notice.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spug_web/src/pages/home/Notice.js b/spug_web/src/pages/home/Notice.js index d4b41d1..3ed4f61 100644 --- a/spug_web/src/pages/home/Notice.js +++ b/spug_web/src/pages/home/Notice.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Button, Card, List, Modal, Form, Input, Switch, Divider, Tag } from 'antd'; +import { Button, Card, List, Modal, Form, Input, Switch, Divider } from 'antd'; import { DownSquareOutlined, PlusOutlined, UpSquareOutlined, SoundOutlined } from '@ant-design/icons'; import { http } from 'libs'; import styles from "./index.module.less"; @@ -21,7 +21,14 @@ function NoticeIndex(props) { function fetch() { setFetching(true); http.get('/api/notice/') - .then(res => setRecords(res)) + .then(res => { + setRecords(res); + for (let item of res) { + if (item.is_stress && !item.read_ids.includes(id)) { + setNotice(item) + } + } + }) .finally(() => setFetching(false)) }