This commit is contained in:
ch197511161
2025-12-11 02:09:07 +08:00
parent 54d6acbce3
commit aaaf08e8f3
84 changed files with 4131 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/**
* 飞书应用配置
* 将敏感信息配置在服务端,避免前端暴露
*/
export const FEISHU_CONFIG = {
// 默认应用配置 - 从环境变量获取
DEFAULT_APP_TOKEN: process.env.FEISHU_DEFAULT_APP_TOKEN || 'YDtMbwqBkangyistqmicDAH0nag',
DEFAULT_TABLE_ID: process.env.FEISHU_DEFAULT_TABLE_ID || 'tblGRc1MSmQfonb2',
// 应用凭证 - 从环境变量获取
APP_ID: process.env.FEISHU_APP_ID || '',
APP_SECRET: process.env.FEISHU_APP_SECRET || '',
}
/**
* 获取飞书应用配置
* @param tableId 可选的表格ID如果不提供则使用默认配置
* @returns 返回完整的配置信息app_token完全从服务端获取
*/
export function getFeishuConfig(tableId?: string) {
return {
appToken: FEISHU_CONFIG.DEFAULT_APP_TOKEN, // app_token完全从服务端配置获取不从前端传递
tableId: tableId || FEISHU_CONFIG.DEFAULT_TABLE_ID,
appId: FEISHU_CONFIG.APP_ID,
appSecret: FEISHU_CONFIG.APP_SECRET,
}
}