Ver código fonte

fix(控制台): 修复打开页面时URL拼接错误的问题

修正openPage函数中URL拼接逻辑,使用window.location.pathname确保正确生成完整URL
zhanghaijun 11 meses atrás
pai
commit
f21b6b0d85
1 arquivos alterados com 2 adições e 3 exclusões
  1. 2 3
      src/views/dashboard/console/index.vue

+ 2 - 3
src/views/dashboard/console/index.vue

@@ -70,9 +70,8 @@
   const router = useRouter()
 
   const openPage = (url: string) => {
-    router.push(url)
-    // const routeUrl = router.resolve(url)
-    // window.open(window.location.origin + routeUrl.href, '_blank')
+    const routeUrl = router.resolve(url)
+    window.open(window.location.origin + window.location.pathname + routeUrl.href, '_blank')
   }
 </script>