user.js 583B

1234567891011121314151617181920212223242526272829
  1. import ajax from '../../util/ajax'
  2. import api from '../../util/api'
  3. export default {
  4. namespaced: true,
  5. state: {
  6. userinfo: {},
  7. },
  8. mutations: {
  9. updateInfo (state, payload) {
  10. state.userinfo = payload || {}
  11. },
  12. },
  13. actions: {
  14. GetUserByTel ({ commit }, { tel }) {
  15. ajax(api.systemSet.getUserByTel.url, {
  16. method: api.systemSet.getUserByTel.method,
  17. urlData: {
  18. tel,
  19. }
  20. }).then(res => {
  21. commit('updateInfo', res)
  22. })
  23. },
  24. SetUserInfoNull ({ commit }) {
  25. commit('updateInfo', {})
  26. }
  27. }
  28. }