expressServer/common/constant/httpStatus.js
LingandRX f7d28672b7 feat(session): 使用 Redis 存储会话数据
- 新增 Redis 配置和连接逻辑
- 更新 express-session 配置,使用 RedisStore 存储会话
- 修改 .env 和 .gitignore 文件,添加 Redis 相关配置
- 更新用户登录和会话管理相关代码
2024-12-30 22:10:51 +08:00

71 lines
1.8 KiB
JavaScript
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.

/**
* HTTP 状态码常量
*/
const HTTP_STATUS = {
// 信息响应 (100199)
/** @type {number} 继续 */
CONTINUE: 100,
/** @type {number} 协议切换 */
SWITCHING_PROTOCOLS: 101,
// 成功响应 (200299)
/** @type {number} 请求成功 */
OK: 200,
/** @type {number} 请求成功并且服务器创建了新的资源 */
CREATED: 201,
/** @type {number} 已接受 */
ACCEPTED: 202,
/** @type {number} 没有内容 */
NO_CONTENT: 204,
// 重定向消息 (300399)
/** @type {number} 永久移动 */
MOVED_PERMANENTLY: 301,
/** @type {number} 找到 */
FOUND: 302,
/** @type {number} 查看其他位置 */
SEE_OTHER: 303,
/** @type {number} 临时重定向 */
TEMPORARY_REDIRECT: 307,
// 客户端错误响应 (400499)
/** @type {number} 错误请求 */
BAD_REQUEST: 400,
/** @type {number} 未授权 */
UNAUTHORIZED: 401,
/** @type {number} 禁止 */
FORBIDDEN: 403,
/** @type {number} 未找到 */
NOT_FOUND: 404,
/** @type {number} 方法禁用 */
METHOD_NOT_ALLOWED: 405,
/** @type {number} 不接受 */
NOT_ACCEPTABLE: 406,
/** @type {number} 请求超时 */
REQUEST_TIMEOUT: 408,
/** @type {number} 冲突 */
CONFLICT: 409,
/** @type {number} 已删除 */
GONE: 410,
/** @type {number} 负载过大 */
PAYLOAD_TOO_LARGE: 413,
/** @type {number} URI 过长 */
URI_TOO_LONG: 414,
/** @type {number} 不支持的媒体类型 */
UNSUPPORTED_MEDIA_TYPE: 415,
// 服务器错误响应 (500599)
/** @type {number} 服务器错误 */
INTERNAL_SERVER_ERROR: 500,
/** @type {number} 未实施 */
NOT_IMPLEMENTED: 501,
/** @type {number} 错误网关 */
BAD_GATEWAY: 502,
/** @type {number} 服务不可用 */
SERVICE_UNAVAILABLE: 503,
/** @type {number} 网关超时 */
GATEWAY_TIMEOUT: 504
}
module.exports = HTTP_STATUS