登录后检查未读公告

release
YCC 2 years ago
parent f745492a12
commit 2775a53bb7

@ -42,7 +42,7 @@ class Notice {
.then(json => { .then(json => {
console.log(json); console.log(json);
runInAction(() => { runInAction(() => {
this.noticeUnRead = json.Result.CCP_BulletinCount; this.noticeInfo = json.Result;
}); });
}) })
.catch(error => { .catch(error => {
@ -59,7 +59,7 @@ class Notice {
.then(json => { .then(json => {
console.log(json); console.log(json);
runInAction(() => { runInAction(() => {
this.noticeInfo = json.Result; this.noticeUnRead = json.Result.CCP_BulletinCount;
}); });
}) })
.catch(error => { .catch(error => {

@ -5,7 +5,7 @@ import { useStore } from '@/stores/StoreContext.js';
function Login() { function Login() {
const { authStore } = useStore(); const { authStore,noticeStore } = useStore();
const { notification } = App.useApp(); const { notification } = App.useApp();
const navigate = useNavigate(); const navigate = useNavigate();
const [form] = Form.useForm(); const [form] = Form.useForm();
@ -13,6 +13,7 @@ function Login() {
const onFinish = (values) => { const onFinish = (values) => {
authStore.valdateUserPassword(values.username, values.password) authStore.valdateUserPassword(values.username, values.password)
.then((userId) => { .then((userId) => {
noticeStore.getBulletinUnReadCount(userId);
authStore.fetchUserDetail(userId) authStore.fetchUserDetail(userId)
.then((user) => { .then((user) => {
// navigate(-1) is equivalent to hitting the back button. // navigate(-1) is equivalent to hitting the back button.

Loading…
Cancel
Save