This commit is contained in:
2023-06-30 15:40:14 +08:00
parent a6bf525fbe
commit dcf9b645f3

View File

@ -266,19 +266,19 @@ const tenantInitCheck = () => {
activeStep.value = 1;
currentStepStatus.value = 1;
return check(tenantId.value)
.then((resp) => {
.catch(() => {
currentStepStatus.value = 2;
activeStep.value = 0;
throw new Error("租户初始化检查失败");
}).then((resp) => {
tenantInitCheckResult.value = resp;
if (resp.result === 200) {
currentStepStatus.value = 2;
} else {
currentStepStatus.value = 0;
throw new Error("租户初始化检查失败");
}
})
.catch(() => {
currentStepStatus.value = 2;
activeStep.value = 0;
throw new Error("租户初始化检查失败");
});
};
// 第二步: 创建数据库
@ -287,19 +287,19 @@ const createDatabase = () => {
activeStep.value = 2;
currentStepStatus.value = 1;
return createTables(tenantId.value)
.then((resp) => {
.catch(() => {
currentStepStatus.value = 2;
activeStep.value = 1;
throw new Error("创建数据库失败");
}).then((resp) => {
createTablesResult.value = resp;
if (resp.result === 200) {
currentStepStatus.value = 2;
} else {
currentStepStatus.value = 0;
throw new Error("创建数据库失败");
}
})
.catch(() => {
currentStepStatus.value = 2;
activeStep.value = 1;
throw new Error("创建数据库失败");
});
};
// 第三步,导入数据
@ -308,19 +308,19 @@ const importData = () => {
activeStep.value = 3;
currentStepStatus.value = 1;
return initData(tenantId.value)
.then((resp) => {
.catch(() => {
currentStepStatus.value = 2;
activeStep.value = 2;
throw new Error("导入数据失败");
}).then((resp) => {
initDataResult.value = resp;
if (resp.result === 200) {
currentStepStatus.value = 2;
} else {
currentStepStatus.value = 0;
throw new Error("导入数据失败");
}
})
.catch(() => {
currentStepStatus.value = 2;
activeStep.value = 2;
throw new Error("导入数据失败");
});
};
onMounted(() => {