electron launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.4 KiB

4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
  1. const path = require('path');
  2. const data_path = "/home/kylin/tcop/TIS_ZDFWGK_CPP/data/app/xmlx.json";
  3. const fs = require("fs");
  4. let data = null;
  5. exports.MANUAL_CREATED_FLAG = Symbol("MANUAL_CREATED");
  6. exports.MAIN_WINDOW_FLAG = Symbol("MAIN_WINDOW");
  7. exports.SUSPENSION_WINDOW_FLAG = Symbol("SUSPENSION_WINDOW_FLAG");
  8. // exports.MAIN_WINDOW_URL = "file://" + path.resolve(__dirname, '../renderer/pages/main/index.html')
  9. // exports.APP_WINDOW_URL = "file://" + path.resolve(__dirname, '../renderer/pages/main/index.html?view=application')
  10. // exports.LOGIN_WINDOW_URL = "file://" + path.resolve(__dirname, '../renderer/pages/main/index.html?view=login')
  11. try {
  12. data = JSON.parse(fs.readFileSync(data_path,'utf-8'));
  13. }catch (e) {
  14. data = {schema:"QB"}
  15. }
  16. const schema = data.schema;
  17. let url = "";
  18. switch (schema) {
  19. case 'KT':
  20. url = 'http://localhost:8080/';
  21. break;
  22. case 'QB':
  23. url = 'http://localhost:3806/TIS_PLATFORM/';
  24. // url = "file://" + path.resolve(__dirname, './index.html');
  25. break;
  26. default:
  27. url = 'http://localhost:8080/TIS_PLATFORM/';
  28. break;
  29. }
  30. exports.MAIN_WINDOW_URL = url;
  31. exports.SUSPENSION_WINDOW_URL = "file://" + path.resolve(__dirname, '../renderer/pages/suspension/index.html')
  32. // exports.APP_WINDOW_URL = 'http://localhost:8080/?view=application'
  33. // exports.LOGIN_WINDOW_URL = 'http://localhost:8080/?view=login'