Skip to content

Commit

Permalink
fix: yituliu api
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuk1ko committed Jul 5, 2024
1 parent 3e0c579 commit 183c74a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/store/materialValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ export const useMaterialValueStore = defineStore('materialValue', () => {

let fetchFailed = 0;

// TODO 等一图流恢复
const loadData = async (force = false) => {
if (force) {
// fetchData();
fetchData();
return;
}

Expand All @@ -33,17 +32,14 @@ export const useMaterialValueStore = defineStore('materialValue', () => {
}

if (!dataReady.value || dataExpired.value) {
// fetchData();
fetchData();
}
};

// eslint-disable-next-line no-unused-vars
const fetchData = async () => {
if (fetchFailed >= MAX_FETCH_TRY) return;
try {
const res = await fetch(
'https://ark.yituliu.cn/backend/item/value?expCoefficient=0.625',
).then(r => r.json());
const res = await fetch('https://backend.yituliu.cn/item/value').then(r => r.json());
if (!(Array.isArray(res.data) && res.data.length)) {
console.error('[FetchMaterialValueData] fetch failed', res);
throw new Error(res.msg);
Expand Down

0 comments on commit 183c74a

Please sign in to comment.