feat: 提示词
This commit is contained in:
@@ -1,12 +1,2 @@
|
||||
import { requestClient } from '@/api/request'
|
||||
|
||||
/** 账户信息 */
|
||||
interface IAccountInfo {
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
|
||||
/** 获取账户信息 */
|
||||
function getAccountInfo() {
|
||||
return requestClient.get<IAccountInfo>('/account')
|
||||
}
|
||||
export * from './login.ts'
|
||||
export * from './user.ts'
|
||||
|
||||
17
src/api/modules/account/login.ts
Normal file
17
src/api/modules/account/login.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { requestClient } from '@/api/request'
|
||||
|
||||
/** 登录响应数据类型 */
|
||||
export interface ILoginResponse {
|
||||
token: string
|
||||
}
|
||||
|
||||
/** 登录请求数据类型 */
|
||||
export interface ILoginRequest {
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
|
||||
/** 登录 */
|
||||
function login(req: ILoginRequest) {
|
||||
return requestClient.post<ILoginResponse>('/account', req)
|
||||
}
|
||||
12
src/api/modules/account/user.ts
Normal file
12
src/api/modules/account/user.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { requestClient } from '@/api/request'
|
||||
|
||||
/** 账户信息 */
|
||||
export interface IUserInfo {
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
|
||||
/** 获取账户信息 */
|
||||
function getAccountInfo() {
|
||||
return requestClient.get<IUserInfo>('/user/info')
|
||||
}
|
||||
Reference in New Issue
Block a user