constants.js 915 B

12345678910111213141516171819202122232425262728293031
  1. const fs = require('fs');
  2. const path = require('path');
  3. const https = require('https');
  4. const { app } = require('electron');
  5. const cert = fs.readFileSync('server\\Configs\\cer\\cert.pem');
  6. const agent = new https.Agent({
  7. ca: cert,
  8. rejectUnauthorized: true,
  9. // secureProtocol: 'TLSv1_2_method', // 强制使用 TLS 1.2
  10. });
  11. let serverPath;
  12. if (app.isPackaged) {
  13. serverPath = path.dirname(app.getPath('exe'));
  14. } else {
  15. serverPath = __dirname;
  16. }
  17. const port = 8326;
  18. const baseUrl = 'https://exam.habook.local:8326';//端口含义:TEAM 键盘九宫格 T(8) E(3) A(2) M(6)
  19. const remoteVersionsUrl = 'https://teammodelos.blob.core.chinacloudapi.cn/0-public/exam-server/versions.json';
  20. const remoteZipBaseUrl = 'https://teammodelos.blob.core.chinacloudapi.cn/0-public/exam-server';
  21. module.exports = {
  22. port,
  23. serverPath,
  24. baseUrl,
  25. remoteVersionsUrl,
  26. remoteZipBaseUrl,
  27. agent
  28. };