重构前端错误提示

This commit is contained in:
whyour
2022-09-22 23:59:23 +08:00
parent e274d3e2f9
commit f2fea47336
33 changed files with 347 additions and 363 deletions
+3 -2
View File
@@ -36,11 +36,12 @@ const SubscriptionLogModal = ({
? logUrl
: `${config.apiPrefix}subscriptions/${subscription.id}/log`,
)
.then((data: any) => {
.then(({ code, data }) => {
if (
code === 200 &&
localStorage.getItem('logSubscription') === String(subscription.id)
) {
const log = data.data as string;
const log = data as string;
setValue(log || '暂无日志');
setExecuting(log && !log.includes('执行结束'));
if (log && !log.includes('执行结束')) {