国外MOSE官网
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.

57 lines
1.4 KiB

  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import * as api from '@/api'
  4. Vue.use(Vuex)
  5. const store = new Vuex.Store({
  6. state: {
  7. // 存放状态
  8. configList: [],
  9. careerList: [],
  10. qualificationList: []
  11. },
  12. mutations: {
  13. setConfigList(state, data) {
  14. state.configList = data
  15. },
  16. setCareerList(state, data) {
  17. state.careerList = data
  18. },
  19. setQualificationList(state, data) {
  20. state.qualificationList = data
  21. }
  22. },
  23. actions: {
  24. // 查询配置列表
  25. async getConfig({ commit }) {
  26. const res = await api.config.queryConfigList()
  27. // if (res.code === 0) {
  28. commit('setConfigList', res.result.records)
  29. // } else {
  30. // uni.showToast({ title: res.msg, icon: 'error' })
  31. // }
  32. },
  33. // 查询职业列表
  34. async getCareer({ commit }) {
  35. const res = await api.config.queryCareerList()
  36. // if (res.code === 0) {
  37. commit('setCareerList', res.result.records)
  38. // } else {
  39. // uni.showToast({ title: res.msg, icon: 'error' })
  40. // }
  41. },
  42. // 查询学历列表
  43. async getQualification({ commit }) {
  44. const res = await api.config.queryQualificationList()
  45. // if (res.code === 0) {
  46. commit('setQualificationList', res.result.records)
  47. // } else {
  48. // uni.showToast({ title: res.msg, icon: 'error' })
  49. // }
  50. }
  51. }
  52. })
  53. export default store