config.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import ajax from '@/api/userApi'
  4. // import router from '@/router'
  5. Vue.use(Vuex)
  6. const store = new Vuex.Store({
  7. state: {
  8. isLogin: false,
  9. luyou: 1,
  10. userInfo: {
  11. userid: "",
  12. username: "",
  13. type: 2,
  14. },
  15. Notify: [],
  16. NotifyDig: false,
  17. systemState: 1,
  18. nCount: 0,
  19. report: "",
  20. // api: 'https://pbl.cocorobo.cn/api/pbl/',
  21. // socket: "https://poll.cocorobo.cn",
  22. // socket: "http://localhost:1473",
  23. // api: 'http://10.3.16.226:7003/api',//qgt后端
  24. api: 'https://cxcy.ssti.net.cn:7003/api', //服务器
  25. // api: 'http://127.0.0.1:7003/api',
  26. // api: 'http://10.3.13.84:7003/api',
  27. },
  28. mutations: {
  29. update(state, [key, value]) {
  30. state[key] = value;
  31. },
  32. getPlanEndProjectData(state) {
  33. console.log("获取信息")
  34. ajax.get(state.api + "/SelectProjectEndData", {
  35. uid: state.userInfo.userid
  36. }).then(res => {
  37. state.Notify = res['data'][0];
  38. if (state.Notify.length > 0) state.NotifyDig = true;
  39. console.log(res['data'][0])
  40. }).catch(err => {
  41. console.log(err)
  42. })
  43. }
  44. },
  45. })
  46. export default store