您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

termsConditions.js 790B

1234567891011121314151617181920212223242526272829303132
  1. /* eslint-disable */
  2. import axios from "axios";
  3. export default {
  4. namespaced: true,
  5. state: {
  6. terms: []
  7. },
  8. mutations: {
  9. getTermsAndConditions: (state, fee) => (state.terms = fee),
  10. newTermsAndConditions: (state, fee) => (state.terms = fee)
  11. },
  12. getters: {
  13. getTermsAndConditions: state => state.terms
  14. },
  15. actions: {
  16. async retrieveTerms({ commit }) {
  17. await axios.get("api/tc/").then(res => {
  18. commit("getTermsAndConditions", res.data);
  19. });
  20. },
  21. async setTerms({ commit }, terms) {
  22. const response = await axios.post("api/tc/", terms);
  23. if (response.status === 200) {
  24. commit("newTermsAndConditions", response.data);
  25. return Promise.resolve();
  26. } else {
  27. return Promise.reject();
  28. }
  29. }
  30. }
  31. };