fix: 已有数据库再次安装时接上原库而不是报错
This commit is contained in:
@@ -40,7 +40,7 @@ async function submit() {
|
||||
busy.value = true;
|
||||
errorText.value = "";
|
||||
try {
|
||||
await api("/api/install", {
|
||||
const result = await api<{ already?: boolean }>("/api/install", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
host: host.value,
|
||||
@@ -53,7 +53,7 @@ async function submit() {
|
||||
}),
|
||||
});
|
||||
markInstalled();
|
||||
router.push("/login");
|
||||
router.push(result.already ? { path: "/login", query: { notice: "already" } } : "/login");
|
||||
} catch (error) {
|
||||
errorText.value = error instanceof Error ? error.message : "安装失败";
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user