expressServer/common/constant/httpStatus.js
LingandRX fbbcf675d1 refactor(user): 重构用户相关代码
- 优化了用户路由、控制器、仓库和服务的代码结构
- 改进了代码的可读性和可维护性
-移除了冗余的导入和导出语句
- 统一了异步函数的定义方式- 简化了错误处理逻辑
2025-01-05 18:44:46 +08:00

69 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 状态码常量
*/
export 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
}