fgv2.0 平台 electron 打包桌面应用
whychw
2026-03-19 c3f4ce9d1789c62fead2f4ea1383829574d809f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const fs = require("fs");
const path = require("path");
 
// 获取配置文件的绝对路径
const configFilePath = path.join(__dirname, "./config.json");
 
// console.log(configFilePath, 'path');
// 读取配置文件内容
const readConfigFile = () => {
  try {
    const configData = fs.readFileSync(configFilePath, "utf-8");
    return JSON.parse(configData);
  } catch (error) {
    console.error("Error reading config file:", error);
    return error;
  }
};
 
module.exports = {
  readConfigFile,
};