feat: 实现基础设施层
axios 请求封装及七个业务模块 API,Pinia 状态管理(auth/system/models/tools),Mock 适配器与数据,以及流式对话、轮询、倒计时组合式函数。
This commit is contained in:
12
frontend/src/api/modules/system.ts
Normal file
12
frontend/src/api/modules/system.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { get, post } from '../request'
|
||||
import type { SystemInfo, HealthMetrics } from '@/types'
|
||||
|
||||
/** 系统信息(CPU/内存/磁盘/GPU/网络/系统) */
|
||||
export const getSystemInfo = () => get<SystemInfo>('/system-info')
|
||||
|
||||
/** 健康指标(顶部栏轻量指标) */
|
||||
export const getHealth = () => get<HealthMetrics>('/health')
|
||||
|
||||
/** 登录 */
|
||||
export const login = (username: string, password: string) =>
|
||||
post('/login', { username, password })
|
||||
Reference in New Issue
Block a user