Files
DianZhanDemo/server/config/feishu-config.ts
ch197511161 aaaf08e8f3 init6
2025-12-11 02:09:07 +08:00

28 lines
980 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 飞书应用配置
* 将敏感信息配置在服务端,避免前端暴露
*/
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,
}
}