Przeglądaj źródła

refactor(api): 将登录相关类型定义移动到types目录下

feige996 10 miesięcy temu
rodzic
commit
edefc99702
3 zmienionych plików z 2 dodań i 59 usunięć
  1. 1 1
      src/api/login.ts
  2. 0 57
      src/api/login.typings.ts
  3. 1 1
      src/store/user.ts

+ 1 - 1
src/api/login.ts

@@ -1,4 +1,4 @@
-import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './login.typings'
+import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './types/login'
 import { http } from '@/utils/http'
 
 /**

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

@@ -1,57 +0,0 @@
-/**
- * 用户信息
- */
-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
-}

+ 1 - 1
src/store/user.ts

@@ -1,4 +1,4 @@
-import type { IUserInfoVo } from '@/api/login.typings'
+import type { IUserInfoVo } from '@/api/types/login'
 import { defineStore } from 'pinia'
 import { ref } from 'vue'
 import {