优化插件管理逻辑

This commit is contained in:
技术老胡
2025-02-24 13:07:07 +08:00
parent c469680ae4
commit 1d55442388
5 changed files with 18 additions and 38 deletions

View File

@@ -126,10 +126,11 @@
const field = data.field;
(async () => {
const saveRes = await fetch('/install/install', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(field) });
if (saveRes.status != 200) { layer.msg('保存数据库配置失败'); return; }
const saveJson = await saveRes.json();
if (saveJson.code == 0) {
const initRes = await fetch('/install/init', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(field) });
if (initRes.status != 200) { layer.msg('初始化失败,请检查配置'); return; }
if (initRes.status != 200) { layer.msg('初始化数据失败,请检查配置'); return; }
const initJson = await initRes.json();
if (initJson.code == 0) {
layer.msg(initJson.msg, {