From d76c7d2f2c9187a551dd8e2c3207ef67c9370260 Mon Sep 17 00:00:00 2001 From: arily Date: Tue, 31 Dec 2024 12:21:23 +0800 Subject: [PATCH] add error message --- src/middleware/auth.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/middleware/auth.ts b/src/middleware/auth.ts index ffaa2d8fb..eb318b29c 100644 --- a/src/middleware/auth.ts +++ b/src/middleware/auth.ts @@ -1,3 +1,4 @@ +import { GucchoError } from '~/def/messages' import { useSession } from '~/store/session' export default defineNuxtRouteMiddleware((to) => { @@ -8,6 +9,7 @@ export default defineNuxtRouteMiddleware((to) => { query: { redirect: to.fullPath, }, + message: fromGucchoErrorCode(GucchoError.YouNeedToLogin), } return returnValue