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

feat: 修复

parent 715c2a17
......@@ -7,23 +7,23 @@ const GlobalModel = {
notices: [],
},
effects: {
*fetchNotices(_, { call, put, select }) {
const data = yield call(queryNotices);
yield put({
type: 'saveNotices',
payload: data,
});
const unreadCount = yield select(
state => state.global.notices.filter(item => !item.read).length,
);
yield put({
type: 'user/changeNotifyCount',
payload: {
totalCount: data.length,
unreadCount,
},
});
},
// *fetchNotices(_, { call, put, select }) {
// const data = yield call(queryNotices);
// yield put({
// type: 'saveNotices',
// payload: data,
// });
// const unreadCount = yield select(
// state => state.global.notices.filter(item => !item.read).length,
// );
// yield put({
// type: 'user/changeNotifyCount',
// payload: {
// totalCount: data.length,
// unreadCount,
// },
// });
// },
*clearNotices({ payload }, { put, select }) {
yield put({
......
import { queryCurrent, queryUsers, homeInfo } from '@/services/user';
// queryUsers
import { queryCurrent, homeInfo } from '@/services/user';
import localStorage from '@/utils/localStorage';
const UserModel = {
......@@ -8,13 +9,13 @@ const UserModel = {
homeInfo: {},
},
effects: {
*fetch(_, { call, put }) {
const response = yield call(queryUsers);
yield put({
type: 'save',
payload: response,
});
},
// *fetch(_, { call, put }) {
// const response = yield call(queryUsers);
// yield put({
// type: 'save',
// payload: response,
// });
// },
*fetchCurrent(_, { call, put }) {
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