aixxai 1.7.4 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aixxai",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "AIXX CLI - 让你的AI调用万物。One command, every AI model. By AIXX (Wanan Exchange), the verification-first compute exchange. 安装:npx aixxai",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,10 +30,16 @@ function loadToken() {
30
30
  const conf = JSON.parse(readFileSync(f, 'utf-8'));
31
31
  if (conf.marketToken) return conf.marketToken;
32
32
  if (conf.aciBetaToken) return conf.aciBetaToken;
33
- if (conf.AIXX_API_KEY) return conf.AIXX_API_KEY;
34
33
  }
35
34
  } catch (e) { /* 走未配置路径 */ }
36
- if (process.env.AIXX_API_KEY) return process.env.AIXX_API_KEY;
35
+ if (process.env.AIXX_API_KEY) return process.env.AIXX_API_KEY; // 1121: env先于config(千问测AIXX_API_KEY切换key被config压住的bug)
36
+ try {
37
+ const f = configFile();
38
+ if (existsSync(f)) {
39
+ const conf2 = JSON.parse(readFileSync(f, 'utf-8'));
40
+ if (conf2.AIXX_API_KEY) return conf2.AIXX_API_KEY;
41
+ }
42
+ } catch (e) { /* 走未配置路径 */ }
37
43
  try {
38
44
  const acc = join(homedir(), '.aixx', 'account.json');
39
45
  if (existsSync(acc)) {