dashboard.ts 564 B

1234567891011121314151617181920212223
  1. import { http } from "@/utils/http";
  2. export type Result = {
  3. code: number;
  4. message: string;
  5. data: any;
  6. };
  7. export const getOverview = () => {
  8. return http.request<Result>("get", "/dashboard/overview");
  9. };
  10. export const getStatistics = (type: string = "week") => {
  11. return http.request<Result>("get", `/dashboard/statistics?type=${type}`);
  12. };
  13. export const getQuickLinks = () => {
  14. return http.request<Result>("get", "/dashboard/quick-links");
  15. };
  16. export const getDeviceStatus = () => {
  17. return http.request<Result>("get", "/dashboard/device-status");
  18. };