config.js 1.4 KB

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