Просмотр исходного кода

dev-修复:顶部搜索无响应

bruce 5 лет назад
Родитель
Сommit
fad8f4e853
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      components/header.vue

+ 8 - 2
components/header.vue

@@ -379,8 +379,14 @@ export default {
       location.href = this.baseUrl + url;
       location.href = this.baseUrl + url;
     },
     },
     clickInputEnter() {
     clickInputEnter() {
-      console.log("location ==", this.$route.path + "/?keyword=" + this.keywork);
-      window.location.href = this.$route.path + "/?keyword=" + this.keywork;
+      let url = "";
+      if (this.$route.name === "job") {
+        url = "/?keyword=" + this.keywork;
+      } else if (this.$route.fullPath.indexOf("jishuin") > -1) {
+        url = "/user/searchTopic?keyword=" + this.keywork;
+      }
+      console.log(url);
+      window.location.href = url;
     },
     },
     async getMessageCount() {
     async getMessageCount() {
       let res = await this.$axios.$get(
       let res = await this.$axios.$get(