constants.js 785 B

1234567891011121314151617181920212223242526272829
  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. });
  10. let serverPath;
  11. if (app.isPackaged) {
  12. serverPath = path.dirname(app.getPath('exe'));
  13. } else {
  14. serverPath = __dirname;
  15. }
  16. const baseUrl = 'https://exam.habook.local:8888';
  17. const remoteVersionsUrl = 'https://teammodelos.blob.core.chinacloudapi.cn/0-public/exam-server/versions.json';
  18. const remoteZipBaseUrl = 'https://teammodelos.blob.core.chinacloudapi.cn/0-public/exam-server';
  19. module.exports = {
  20. serverPath,
  21. baseUrl,
  22. remoteVersionsUrl,
  23. remoteZipBaseUrl,
  24. agent
  25. };