feat: three nuxt frontends, demo seed, rounding + money-exponent + rate-cast fixes, archived specs

This commit is contained in:
Chengdong Zhang
2026-09-17 13:34:38 +08:00
parent dc9fd31c5e
commit 653f13161a
85 changed files with 4327 additions and 106 deletions
+15
View File
@@ -0,0 +1,15 @@
export default defineNuxtRouteMiddleware(() => {
if (import.meta.server) return;
const token = localStorage.getItem("vmall.token");
let role: string | null = null;
try {
const raw = localStorage.getItem("vmall.user");
const user: unknown = raw ? JSON.parse(raw) : null;
if (user && typeof user === "object" && "role" in user && typeof user.role === "string") {
role = user.role;
}
} catch {
role = null;
}
if (!token || role !== "customer") return navigateTo("/login");
});