FEAT => 本次更新项目为:
废弃流量池不需要的接口
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import request from "@/api/request";
|
||||
import type { TrafficPoolListResponse, DeviceOption } from "./data";
|
||||
import type { DeviceOption } from "./data";
|
||||
import { fetchDeviceList } from "@/pages/guide/api";
|
||||
|
||||
// 获取流量池列表
|
||||
@@ -11,16 +11,6 @@ export function fetchTrafficPoolList(params: {
|
||||
return request("/v1/traffic/pool", params, "GET");
|
||||
}
|
||||
|
||||
// 获取设备列表(真实接口)
|
||||
export async function fetchDeviceOptions(): Promise<DeviceOption[]> {
|
||||
const res = await fetchDeviceList({ page: 1, limit: 100 });
|
||||
// 假设返回 { list: [{ id, name, ... }], ... }
|
||||
return (res.list || []).map((item: any) => ({
|
||||
id: String(item.id),
|
||||
name: item.name,
|
||||
}));
|
||||
}
|
||||
|
||||
// 获取分组列表(如无真实接口可用mock)
|
||||
export async function fetchPackageOptions(): Promise<any[]> {
|
||||
// TODO: 替换为真实接口
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import {
|
||||
fetchTrafficPoolList,
|
||||
fetchDeviceOptions,
|
||||
fetchPackageOptions,
|
||||
} from "./api";
|
||||
import { fetchTrafficPoolList, fetchPackageOptions } from "./api";
|
||||
import type {
|
||||
TrafficPoolUser,
|
||||
DeviceOption,
|
||||
@@ -69,7 +65,6 @@ export function useTrafficPoolListLogic() {
|
||||
|
||||
// 获取筛选项
|
||||
useEffect(() => {
|
||||
fetchDeviceOptions().then(setDeviceOptions);
|
||||
fetchPackageOptions().then(setPackageOptions);
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user