Parcourir la source

修改搜索跳转逻辑:区分兼职和技术圈

bruce il y a 5 ans
Parent
commit
ee512de4eb
1 fichiers modifiés avec 7 ajouts et 5 suppressions
  1. 7 5
      components/header.vue

+ 7 - 5
components/header.vue

@@ -379,11 +379,13 @@
         location.href = this.baseUrl + url;
       },
       clickInputEnter() {
-        console.log("location ==", this.$route.path + "/?keyword=" + this.keywork);
-        console.log("window.location ==", window.location.href);
-        console.log("windown.location.hostname=", window.location.hostname);
-        console.log("windown.location.pathname=", window.location.pathname);
-        let url = "/?keyword=" + this.keywork;
+        console.log("route.name ==", this.$route.name);
+        let url = "";
+        if (this.$route.name === "job") {
+          url = "/?keyword=" + this.keywork;
+        } else if (this.$route.name === "jishuin") {
+          url = "/user/searchTopic?keyword=" + this.keywork;
+        }
         console.log(url);
         window.location.href = url;
       },