file.js 524 B

123456789101112131415161718192021222324252627282930
  1. import { queryOSSData } from '@/services/boom';
  2. import { message } from 'antd';
  3. export default {
  4. namespace: 'file',
  5. state: {
  6. OSSData: {},
  7. },
  8. effects: {
  9. *queryOSSData({}, { call, put }) {
  10. const response = yield call(queryOSSData);
  11. if (response) {
  12. yield put({
  13. type: 'save',
  14. payload: { OSSData: response.data },
  15. });
  16. }
  17. },
  18. },
  19. reducers: {
  20. save(state, action) {
  21. return {
  22. ...state,
  23. ...action.payload,
  24. };
  25. },
  26. },
  27. };