App.vue 824 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div id="app">
  3. <router-view/>
  4. </div>
  5. </template>
  6. <script>
  7. import { specialIpcRoute, httpConfig } from '@/api/main';
  8. export default {
  9. name: 'App',
  10. components: {},
  11. data() {
  12. return {};
  13. },
  14. watch: {},
  15. mounted() {
  16. this.init()
  17. },
  18. methods: {
  19. init: ()=>{
  20. var { ipcRenderer: ipc } = window.require && window.require('electron');
  21. ipc.removeAllListeners(specialIpcRoute.javaPort);
  22. ipc.on(specialIpcRoute.javaPort, (event, result) => {
  23. if (result && result !== '') {
  24. httpConfig.baseURL = result;
  25. }
  26. });
  27. }
  28. }
  29. }
  30. </script>
  31. <style>
  32. #app {
  33. font-family: Avenir, Helvetica, Arial, sans-serif;
  34. -webkit-font-smoothing: antialiased;
  35. -moz-osx-font-smoothing: grayscale;
  36. text-align: center;
  37. color: #2c3e50;
  38. height: 100%;
  39. }
  40. </style>