File size: 273 Bytes
50852f0
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
/**

 * 从请求头获取认证信息

 * @param {Object} req - Express 请求对象

 * @returns {string|undefined} 认证令牌

 */
export function getAuthHeader(req) {
  return req.headers.authorization || req.headers.Authorization || req.headers['x-api-key']
}