configStore.js 534 B

1234567891011121314151617181920212223242526272829303132
  1. import http from '../common/request'
  2. export default {
  3. state: {
  4. webrtc: {}
  5. },
  6. mutations: {
  7. setConfig(state, config) {
  8. state.webrtc = config.webrtc;
  9. },
  10. clear(state){
  11. state.webrtc = {};
  12. }
  13. },
  14. actions:{
  15. loadConfig(context){
  16. return new Promise((resolve, reject) => {
  17. http({
  18. url: '/system/config',
  19. method: 'GET'
  20. }).then((config) => {
  21. console.log("系统配置",config)
  22. context.commit("setConfig",config);
  23. resolve();
  24. }).catch((res)=>{
  25. reject(res);
  26. });
  27. })
  28. }
  29. }
  30. }