samlax12 commited on
Commit
44f14b9
·
verified ·
1 Parent(s): 5dcb51b

Update constants.ts

Browse files
Files changed (1) hide show
  1. constants.ts +6 -3
constants.ts CHANGED
@@ -6,6 +6,7 @@ export interface ApiChannel {
6
  apiKey: string;
7
  isDefault: boolean;
8
  isCustom: boolean;
 
9
  timeout?: number;
10
  headers?: Record<string, string>;
11
  description?: string;
@@ -41,12 +42,13 @@ export const DEFAULT_CHANNELS: ApiChannel[] = [
41
  {
42
  id: 'default-free-api',
43
  name: '免费API服务',
44
- baseUrl: 'https://api.chatanywhere.tech/v1',
45
- apiKey: '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',
46
  isDefault: true,
47
  isCustom: false,
 
48
  timeout: 30000,
49
- description: '预配置的免费API服务,开箱即用',
50
  createdAt: new Date()
51
  },
52
  {
@@ -56,6 +58,7 @@ export const DEFAULT_CHANNELS: ApiChannel[] = [
56
  apiKey: '', // 用户需要自行配置
57
  isDefault: false,
58
  isCustom: false,
 
59
  timeout: 30000,
60
  description: 'OpenAI 官方API服务(需要用户自行配置API密钥)',
61
  createdAt: new Date()
 
6
  apiKey: string;
7
  isDefault: boolean;
8
  isCustom: boolean;
9
+ isProtected?: boolean; // 新增:标记是否为受保护的预置密钥
10
  timeout?: number;
11
  headers?: Record<string, string>;
12
  description?: string;
 
42
  {
43
  id: 'default-free-api',
44
  name: '免费API服务',
45
+ baseUrl: 'https://api.oaipro.com/v1',
46
+ apiKey: 'sk-2mUFC3yjbSfoteyBYpwHhALvtZdgwBkEWsjWHysg4mWaA7sMWLHc',
47
  isDefault: true,
48
  isCustom: false,
49
+ isProtected: true, // 标记为受保护,用户不可查看或修改密钥
50
  timeout: 30000,
51
+ description: '预配置的免费API服务,开箱即用(API密钥已预置且受保护)',
52
  createdAt: new Date()
53
  },
54
  {
 
58
  apiKey: '', // 用户需要自行配置
59
  isDefault: false,
60
  isCustom: false,
61
+ isProtected: false, // 不受保护,用户可以配置
62
  timeout: 30000,
63
  description: 'OpenAI 官方API服务(需要用户自行配置API密钥)',
64
  createdAt: new Date()