重构用户个人中心页面,新增HTTP请求方法常量模块 - 创建constants/http.ts定义HTTP方法常量 - 在API模块中使用HTTP常量替代字符串 - 重写用户中心页面,增加编辑资料和账号安全功能 - 添加头像上传、密码修改、邮箱绑定等功能
16 lines
295 B
TypeScript
16 lines
295 B
TypeScript
/**
|
|
* HTTP 请求方法常量
|
|
*/
|
|
export const HttpMethod = {
|
|
GET: 'GET',
|
|
POST: 'POST',
|
|
PUT: 'PUT',
|
|
DELETE: 'DELETE',
|
|
PATCH: 'PATCH',
|
|
HEAD: 'HEAD',
|
|
OPTIONS: 'OPTIONS',
|
|
} as const;
|
|
|
|
// 导出类型以供使用
|
|
export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
|