Explorar o código

fix: 登录后getTopMenu()可能返回undefined导致跳转crash

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline hai 2 semanas
pai
achega
e9729dfe96
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      haha-admin-web/src/views/login/index.vue

+ 1 - 1
haha-admin-web/src/views/login/index.vue

@@ -64,7 +64,7 @@ const onLogin = async (formEl: FormInstance | undefined) => {
             return initRouter().then(() => {
               disabled.value = true;
               router
-                .push(getTopMenu(true).path)
+                .push(getTopMenu(true)?.path || "/")
                 .then(() => {
                   message("登录成功", { type: "success" });
                 })