feat: 1
This commit is contained in:
12
src/api/modules/account/index.ts
Normal file
12
src/api/modules/account/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { requestClient } from '@/api/request'
|
||||
|
||||
/** 账户信息 */
|
||||
interface IAccountInfo {
|
||||
id: number
|
||||
username: string
|
||||
}
|
||||
|
||||
/** 获取账户信息 */
|
||||
function getAccountInfo() {
|
||||
return requestClient.get<IAccountInfo>('/account')
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createDiscreteApi } from 'naive-ui'
|
||||
import { eventBus, AppEvents } from '@/utils/eventBus'
|
||||
import { eventBus, AppEvents } from '@/utils'
|
||||
import type { RequestErrorEvent } from './types'
|
||||
|
||||
/** 离散式 API(可在组件外使用) */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios, { type AxiosInstance, type AxiosRequestConfig, type CreateAxiosDefaults } from 'axios'
|
||||
import { useAccountStore } from '@/stores'
|
||||
import { eventBus, AppEvents } from '@/utils/eventBus'
|
||||
import { eventBus, AppEvents } from '@/utils'
|
||||
import type { ApiResponse, InternalRequestConfig, RequestErrorEvent } from './types'
|
||||
|
||||
/**
|
||||
|
||||
2
src/utils/index.ts
Normal file
2
src/utils/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './eventBus.ts'
|
||||
export * from './useDebouncedRef.ts'
|
||||
Reference in New Issue
Block a user