Commit acacbcc2 authored by 张子雨's avatar 张子雨

feat: 修复

parent 715c2a17
...@@ -7,23 +7,23 @@ const GlobalModel = { ...@@ -7,23 +7,23 @@ const GlobalModel = {
notices: [], notices: [],
}, },
effects: { effects: {
*fetchNotices(_, { call, put, select }) { // *fetchNotices(_, { call, put, select }) {
const data = yield call(queryNotices); // const data = yield call(queryNotices);
yield put({ // yield put({
type: 'saveNotices', // type: 'saveNotices',
payload: data, // payload: data,
}); // });
const unreadCount = yield select( // const unreadCount = yield select(
state => state.global.notices.filter(item => !item.read).length, // state => state.global.notices.filter(item => !item.read).length,
); // );
yield put({ // yield put({
type: 'user/changeNotifyCount', // type: 'user/changeNotifyCount',
payload: { // payload: {
totalCount: data.length, // totalCount: data.length,
unreadCount, // unreadCount,
}, // },
}); // });
}, // },
*clearNotices({ payload }, { put, select }) { *clearNotices({ payload }, { put, select }) {
yield put({ yield put({
......
import { queryCurrent, queryUsers, homeInfo } from '@/services/user'; // queryUsers
import { queryCurrent, homeInfo } from '@/services/user';
import localStorage from '@/utils/localStorage'; import localStorage from '@/utils/localStorage';
const UserModel = { const UserModel = {
...@@ -8,13 +9,13 @@ const UserModel = { ...@@ -8,13 +9,13 @@ const UserModel = {
homeInfo: {}, homeInfo: {},
}, },
effects: { effects: {
*fetch(_, { call, put }) { // *fetch(_, { call, put }) {
const response = yield call(queryUsers); // const response = yield call(queryUsers);
yield put({ // yield put({
type: 'save', // type: 'save',
payload: response, // payload: response,
}); // });
}, // },
*fetchCurrent(_, { call, put }) { *fetchCurrent(_, { call, put }) {
const response = yield call(queryCurrent); const response = yield call(queryCurrent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment