import http from '@/utils/http'; import { Mines, MineBasic } from '@/types/common'; import { loadMineList, storeMineList } from '@/utils/storage'; export async function getMineBasic(): Promise { const { ok, data, msg, } = await http.get('/mine/basic'); if (ok && data) { return data; } throw Error(msg); } export async function getMineList(refresh = false): Promise { if (!refresh) { const dataCached = loadMineList(); if (dataCached && dataCached.length) { return dataCached; } } const { ok, data, msg, } = await http.get('/mine/list'); if (ok && data) { storeMineList(data); return data; } throw Error(msg); }