From bf8c45033bad390a8e165ec199720fd39bece95d Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 5 Jun 2024 11:39:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20Notice=20=E8=AF=BB=E5=8F=96userId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/notice/Detail.jsx | 6 +++--- src/views/notice/Index.jsx | 8 ++++---- src/views/report/Index.jsx | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/views/notice/Detail.jsx b/src/views/notice/Detail.jsx index 033903b..575081b 100644 --- a/src/views/notice/Detail.jsx +++ b/src/views/notice/Detail.jsx @@ -1,22 +1,22 @@ import { NavLink, useParams } from 'react-router-dom'; import { useEffect, useState } from 'react'; import { Row, Col, Space, Typography, Divider } from 'antd'; -import { useStore } from '@/stores/StoreContext.js'; import * as comm from '@/utils/commons'; import { useTranslation } from 'react-i18next'; import { fetchNoticeDetail } from '@/stores/Notice'; +import useAuthStore from '@/stores/Auth'; const { Title, Paragraph } = Typography; function Detail() { const { t } = useTranslation(); - const { authStore } = useStore(); const { CCP_BLID } = useParams(); + const [userId, ] = useAuthStore((state) => [state.loginUser.userId]); const [noticeInfo, setNoticeInfo] = useState({}); useEffect(() => { // console.info("notice detail .useEffect " + CCP_BLID); - fetchNoticeDetail(authStore.login.userId, CCP_BLID).then((res) => { + fetchNoticeDetail(userId, CCP_BLID).then((res) => { setNoticeInfo(res); }); }, []); diff --git a/src/views/notice/Index.jsx b/src/views/notice/Index.jsx index f50f333..68a2c19 100644 --- a/src/views/notice/Index.jsx +++ b/src/views/notice/Index.jsx @@ -1,20 +1,20 @@ import { NavLink } from "react-router-dom"; import { useEffect, useState } from "react"; import { Row, Col, Space, Typography, Badge, List } from "antd"; -import { useStore } from "@/stores/StoreContext.js"; import useNoticeStore, { fetchBulletinList } from '@/stores/Notice'; +import useAuthStore from '@/stores/Auth'; function Index() { - const { authStore } = useStore(); + const [userId, ] = useAuthStore((state) => [state.loginUser.userId]); const getBulletinUnReadCount = useNoticeStore((state) => state.getBulletinUnReadCount); const [noticeList, setNoticeList] = useState([]); useEffect(() => { // console.info("notice.useEffect", authStore.login.userId); - fetchBulletinList(authStore.login.userId).then(data => { + fetchBulletinList(userId).then(data => { setNoticeList(data); }); - getBulletinUnReadCount(authStore.login.userId); //进入列表页的时候更新一下未读公告 + getBulletinUnReadCount(userId); //进入列表页的时候更新一下未读公告 }, []); return ( diff --git a/src/views/report/Index.jsx b/src/views/report/Index.jsx index 9e8724e..dcda29c 100644 --- a/src/views/report/Index.jsx +++ b/src/views/report/Index.jsx @@ -325,11 +325,11 @@ function Index() { DMC Assessment Criteria - +

-
+

-
+
Final Scores: {evaluationScores.FinalScores}