store.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. const store = new Vuex.Store({
  5. state: {
  6. openId: localStorage.getItem('openid'),
  7. // 服务器用
  8. // host: "http://www.kzmos.com/tianzong",
  9. host: '/tianzong',
  10. // 本地用
  11. // host:"http://localhost:8080/tianzong",
  12. regEmail: '^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$',
  13. regPhone: '^(1[3-9])\\d{9}$',
  14. jjInfo: {},
  15. sjInfo: {},
  16. sjInfo3: {},
  17. sjList: [],
  18. foreignSjInfo: {},
  19. foreignJjInfo: {},
  20. hkSjInfo: {},
  21. hkJjInfo: {}
  22. },
  23. mutations: {
  24. getId(state, openid) {
  25. state.openId = openid
  26. },
  27. getJjInfo(state, jjInfo) {
  28. state.jjInfo = jjInfo
  29. },
  30. getSjInfo(state, sjInfo) {
  31. state.sjInfo = sjInfo
  32. },
  33. getSjInfo3(state, sjInfo3) {
  34. state.sjInfo3 = sjInfo3
  35. },
  36. getSjList(state, sjList) {
  37. state.sjList = sjList
  38. },
  39. getForeignSjInfo(state, foreignSjInfo) {
  40. state.foreignSjInfo = foreignSjInfo
  41. },
  42. getForeignJjInfo(state, foreignJjInfo) {
  43. state.foreignJjInfo = foreignJjInfo
  44. },
  45. getHkSjInfo(state, hkSjInfo) {
  46. state.hkSjInfo = hkSjInfo
  47. },
  48. getHkJjInfo(state, hkJjInfo) {
  49. state.hkJjInfo = hkJjInfo
  50. }
  51. },
  52. actions: {
  53. }
  54. })
  55. export default store