fix: install process adjustment

This commit is contained in:
shuai 2022-11-09 14:54:06 +08:00
parent 6800cb43b0
commit a5150d06a8
1 changed files with 26 additions and 21 deletions

View File

@ -116,26 +116,6 @@ const Index: FC = () => {
setStep((pre) => pre + 1); setStep((pre) => pre + 1);
}; };
const submitDatabaseForm = () => {
const params = {
lang: formData.lang.value,
db_type: formData.db_type.value,
db_username: formData.db_username.value,
db_password: formData.db_password.value,
db_host: formData.db_host.value,
db_name: formData.db_name.value,
db_file: formData.db_file.value,
};
dbCheck(params)
.then(() => {
handleNext();
})
.catch((err) => {
console.log(err);
handleErr(err);
});
};
const checkInstall = () => { const checkInstall = () => {
const params = { const params = {
lang: formData.lang.value, lang: formData.lang.value,
@ -155,6 +135,27 @@ const Index: FC = () => {
}); });
}; };
const submitDatabaseForm = () => {
const params = {
lang: formData.lang.value,
db_type: formData.db_type.value,
db_username: formData.db_username.value,
db_password: formData.db_password.value,
db_host: formData.db_host.value,
db_name: formData.db_name.value,
db_file: formData.db_file.value,
};
dbCheck(params)
.then(() => {
// handleNext();
checkInstall();
})
.catch((err) => {
console.log(err);
handleErr(err);
});
};
const submitSiteConfig = () => { const submitSiteConfig = () => {
const params = { const params = {
lang: formData.lang.value, lang: formData.lang.value,
@ -183,7 +184,11 @@ const Index: FC = () => {
submitDatabaseForm(); submitDatabaseForm();
} }
if (step === 3) { if (step === 3) {
checkInstall(); if (errorData.msg) {
checkInstall();
} else {
handleNext();
}
} }
if (step === 4) { if (step === 4) {
submitSiteConfig(); submitSiteConfig();