You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.0 KiB

2 years ago
  1. 'use strict';
  2. import {
  3. getTestList,
  4. postTestList
  5. } from '@/api/@pathname@';
  6. const state = {};
  7. const actions = {
  8. /**
  9. * @description postTestList
  10. * @param commit
  11. * @param params
  12. * @returns {Promise<unknown>}
  13. */
  14. getTestList({commit}, params) {
  15. return new Promise((resolve, reject) => {
  16. getTestList(params)
  17. .then((res) => {
  18. console.log('getTestList.res', res.data);
  19. resolve(res.data);
  20. })
  21. .catch((error) => {
  22. reject(error);
  23. })
  24. })
  25. },
  26. /**
  27. * @description 描述
  28. * @param commit
  29. * @param params
  30. * @returns {Promise<unknown>}
  31. */
  32. postTestList({commit}, params) {
  33. return new Promise((resolve, reject) => {
  34. postTestList(params)
  35. .then((res) => {
  36. console.log('postTestList.res', res.data);
  37. resolve(res.data);
  38. })
  39. .catch((error) => {
  40. reject(error);
  41. })
  42. })
  43. },
  44. };
  45. const getters = {};
  46. const mutations = {};
  47. export default {
  48. namespaced: true,
  49. state,
  50. getters,
  51. actions,
  52. mutations
  53. };