Blame view

apps/store/notice/actions.js 768 Bytes
1 2 3 4 5 6 7 8 9 10 11 12
import * as Types from './types'
import { get } from 'lodash';

export default {
    async fetchNoticeList({ commit, state }) {
        if (state.fetchNoticeList) {
          return {};
        }
    
        let page = state.fetchNoticePage || 1;
        commit(Types.FETCH_NOTICE_LIST_REQUEST, { page });
    
bevishuang authored
13 14
        const result = await this.$api.post('/api/ufo/home/noticelist', {
          page,
15
          size: 20,
16 17 18 19 20 21 22 23 24 25 26 27 28
          lastedTime: state.fetchNoticeLastedTime || void 0
        });
        if (result && result.code === 200) {
          commit(Types.FETCH_NOTICE_LIST_SUCCESS, {
            data: result.data,
            page
          });
        } else {
          commit(Types.FETCH_NOTICE_LIST_FAILD);
        }
    
        return result;
      },
TaoHuang authored
29
}