Selaa lähdekoodia

mod:页面跳转

panqiuyao 8 kuukautta sitten
vanhempi
commit
4d8d2774a1
2 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. 6 2
      frontend/src/components/header-bar/index.vue
  2. 6 0
      frontend/src/utils/appfun.ts

+ 6 - 2
frontend/src/components/header-bar/index.vue

@@ -28,6 +28,7 @@ import iconykq from './assets/yaokong@2x.png'
 import iconMinimize from './assets/suoxiao@2x.png' // 新增
 import iconClose from './assets/guanbi@2x.png' // 新增
 import icpList from '@/utils/ipc'
+import { getRouterUrl } from '@/utils/appfun'
 import client from "@/stores/modules/client";
 const clientStore = client();
 
@@ -82,7 +83,10 @@ function getItemIcon(item: MenuItem) {
 }
 
 function openSetting() {
- // let { url } = Router.
+
+  const { href } = Router.resolve({
+    name: 'setting',
+  })
 
   clientStore.ipc.removeAllListeners(icpList.utils.openMain);
   let params = {
@@ -91,7 +95,7 @@ function openSetting() {
     height: 630,
     frame: true,
     id: "seeting",
-    url: "http://localhost:3000/#/setting"
+    url: getRouterUrl(href)
   }
   clientStore.ipc.send(icpList.utils.openMain, params);
 }

+ 6 - 0
frontend/src/utils/appfun.ts

@@ -5,3 +5,9 @@ export  function getFilePath (file_path){
     return null
 }
 
+
+//获取路由地址
+export  function getRouterUrl (href){
+    return window.location.origin+window.location.pathname+href
+}
+