ff-admin/src/router/setupGuard.ts

16 lines
335 B
TypeScript

import NProgress from "nprogress";
import { http } from "@/serverCom";
export async function isSetup(to: any, from: any, next: any) {
NProgress.start();
await http
.get("/setup")
.then(() => {
NProgress.done();
next();
})
.catch(() => {
NProgress.done();
next({ name: "login" });
});
}