猫妈狗爸伴宠师小程序前端代码
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.

30 lines
492 B

  1. import { getConfigList } from '@/api/system'
  2. const system = {
  3. state: {
  4. configList: {},
  5. },
  6. mutations: {
  7. setConfigList(state, list) {
  8. const obj = {}
  9. list.forEach(n => {
  10. obj[n.paramCode] = n;
  11. })
  12. state.configList = obj
  13. }
  14. },
  15. actions: {
  16. async fetchConfigList({commit, state}) {
  17. try {
  18. const data = await getConfigList()
  19. commit('setConfigList', data)
  20. } catch (err) {
  21. }
  22. }
  23. }
  24. }
  25. export default system