Przeglądaj źródła

refactor: 将类型定义文件移动到src/types目录下并添加登录相关类型

将types目录移动到src下以保持项目结构一致性
新增登录相关的类型定义文件,包含用户信息、登录返回数据等接口
feige996 10 miesięcy temu
rodzic
commit
dd11e45d5f
2 zmienionych plików z 58 dodań i 1 usunięć
  1. 1 1
      .gitignore
  2. 57 0
      src/api/types/login.ts

+ 1 - 1
.gitignore

@@ -27,7 +27,7 @@ dist
 docs/.vitepress/dist
 docs/.vitepress/cache
 
-types
+src/types
 
 # lock 文件还是不要了,我主要的版本写死就好了
 # pnpm-lock.yaml

+ 57 - 0
src/api/types/login.ts

@@ -0,0 +1,57 @@
+/**
+ * 用户信息
+ */
+export interface IUserInfoVo {
+  id: number
+  username: string
+  avatar: string
+  token: string
+}
+
+/**
+ * 登录返回的信息
+ */
+export interface IUserLogin {
+  id: string
+  username: string
+  token: string
+}
+
+/**
+ * 获取验证码
+ */
+export interface ICaptcha {
+  captchaEnabled: boolean
+  uuid: string
+  image: string
+}
+/**
+ * 上传成功的信息
+ */
+export interface IUploadSuccessInfo {
+  fileId: number
+  originalName: string
+  fileName: string
+  storagePath: string
+  fileHash: string
+  fileType: string
+  fileBusinessType: string
+  fileSize: number
+}
+/**
+ * 更新用户信息
+ */
+export interface IUpdateInfo {
+  id: number
+  name: string
+  sex: string
+}
+/**
+ * 更新用户信息
+ */
+export interface IUpdatePassword {
+  id: number
+  oldPassword: string
+  newPassword: string
+  confirmPassword: string
+}