mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-24 02:46:37 +08:00
perf: 运营设置-数据刷新逻辑
This commit is contained in:
parent
98c347e048
commit
65ae70919b
@ -40,16 +40,16 @@ export default function SettingsCreditLimit(props) {
|
|||||||
if (requestQueue.length === 1) {
|
if (requestQueue.length === 1) {
|
||||||
if (res.includes(undefined)) return;
|
if (res.includes(undefined)) return;
|
||||||
} else if (requestQueue.length > 1) {
|
} else if (requestQueue.length > 1) {
|
||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败,请重试');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,13 +47,13 @@ export default function DataDashboard(props) {
|
|||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,13 +44,13 @@ export default function SettingsDrawing(props) {
|
|||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,13 +50,13 @@ export default function GeneralSettings(props) {
|
|||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,13 +46,13 @@ export default function SettingsLog(props) {
|
|||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async function onCleanHistoryLog() {
|
async function onCleanHistoryLog() {
|
||||||
|
@ -46,13 +46,13 @@ export default function SettingsMagnification(props) {
|
|||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showError('请检查输入');
|
showError('请检查输入');
|
||||||
|
@ -43,13 +43,13 @@ export default function SettingsMonitoring(props) {
|
|||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,13 +42,13 @@ export default function SettingsSensitiveWords(props) {
|
|||||||
if (res.includes(undefined)) return showError('部分更新失败');
|
if (res.includes(undefined)) return showError('部分更新失败');
|
||||||
}
|
}
|
||||||
showSuccess('更新成功');
|
showSuccess('更新成功');
|
||||||
|
props.refresh();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
showError('更新失败');
|
showError('更新失败');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
props.refresh();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user