1 parent f8e82c7 commit 29db39eCopy full SHA for 29db39e
1 file changed
src/api/client.js
@@ -41,7 +41,13 @@ if (config.useNativeAxios === true) {
41
} else {
42
try {
43
// 使用 src/bin/config.json 作为 TLS 指纹配置文件
44
- const configPath = path.join(__dirname, '..', 'bin', 'tls_config.json');
+ // 检测是否在 pkg 环境中
45
+ const isPkg = typeof process.pkg !== 'undefined';
46
+
47
+ // 根据环境选择配置文件路径
48
+ const configPath = isPkg
49
+ ? path.join(path.dirname(process.execPath), 'bin', 'tls_config.json') // pkg 打包环境
50
+ : path.join(__dirname, '..', 'bin', 'tls_config.json'); // 开发环境
51
requester = fingerprintRequester.create({
52
configPath,
53
timeout: config.timeout ? Math.ceil(config.timeout / 1000) : 30,
0 commit comments