| /** | |
| * 从请求头获取认证信息 | |
| * @param {Object} req - Express 请求对象 | |
| * @returns {string|undefined} 认证令牌 | |
| */ | |
| export function getAuthHeader(req) { | |
| return req.headers.authorization || req.headers.Authorization || req.headers['x-api-key'] | |
| } | |
| /** | |
| * 从请求头获取认证信息 | |
| * @param {Object} req - Express 请求对象 | |
| * @returns {string|undefined} 认证令牌 | |
| */ | |
| export function getAuthHeader(req) { | |
| return req.headers.authorization || req.headers.Authorization || req.headers['x-api-key'] | |
| } | |