haoxuan
2024-04-16 e42df755d23d421fa07602d0ea6cf822986c4b40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
  <div id="header_wrap">
    <div class="header">
      <div class="center">
        <div class="topleft">
          <img src="../../../public/image/home/位图@3x.png" alt="" />
          <input type="text" placeholder="智慧工厂" />
          <span>搜索</span>
        </div>
        <div class="topright">
          <a href="">首页</a>
          <a :href="link">智慧工厂</a>
          <a href="">管理中心</a>
          <a href="">算法</a>
          <a href="">应用</a>
          <a href="">管理服务</a>
          <span class="right-btn"><a :href="link">登录</a></span>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import util from "@/libs/util.js";
import Cookies from "js-cookie";
export default {
  props: {},
  data() {
    return {
      link:""
    };
  },
  computed: {},
  created() {
    this.link=this.getApsPage()
  },
  mounted() {},
  watch: {},
  methods: {
    environmentType(){
      let type
      if (location.href.includes('192.168.20.119')) {
        type = 'test'
      } else if (location.href.includes('192.168') || location.href.includes('localhost')) {
        type = 'dev'
      } else {
        type = 'prod'
      }
      return type
    },
    getApsPage(){
      // let token = util.cookies.get("token");
      // Cookies.set("token", token, { expires: 7, path: "/" });
      // console.log(util.cookies.get("token"),'==token')
      // window.open(`//aps.fai365.com:${getPort()}${this.startPage}`); ${window.location.hostname}
      const loginPathMap = {
        prod:`//aps.fai365.com:9080`,
        test:`//192.168.20.119:9080`,
        dev: `//192.168.8.117:8080`
      }
      return loginPathMap[this.environmentType()]
    },
  },
  components: {},
};
</script>
 
<style scoped lang="scss">
#header_wrap {
  margin: 0 auto;
  .header {
    // width: 1920px;
    width: 100%;
    height: 94px;
    display: flex;
    align-items: center;
    background: #181f30;
    // background: pink;
    box-shadow: 0px 2px 18px 0px rgba(0, 0, 0, 0.12);
    .center {
      margin: 0 auto;
      width: 75%;
      height: 44px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .topleft {
        width: 675px;
        display: flex;
        align-items: center;
        img {
          width: 106.63px;
          height: 22px;
          margin-right: 40px;
        }
        input {
          width: 413px;
          height: 44px;
          box-sizing: border-box;
          padding-left: 20px;
          border: 1.5px solid #ff680d;
          outline: none;
          box-shadow: none;
          font-size: 14px;
          line-height: 20px;
          color: rgba(0, 0, 0, 0.9);
          margin-right: 10px;
        }
        input::-webkit-input-placeholder {
          color: rgba(0, 0, 0, 0.4);
        }
        span {
          text-align: center;
          width: 104px;
          height: 44px;
          background: #ff680d;
          border-color: #ff680d;
          box-shadow: none;
          font-size: 16px;
          line-height: 44px;
          color: #fff;
          cursor: pointer;
          font-family: PingFangSC-Medium, sans-serif;
        }
      }
      .topright {
        width: 533px;
        height: 44px;
        line-height: 44px;
        .right-btn{
          margin-left:40px;
        }
        a {
          margin-left: 40px;
          font-size: 14px;
          // color: rgba(0, 0, 0, 0.9);
          color: #ffffff !important;
          text-decoration: none;
          font-family: PingFangSC-Medium, sans-serif;
        }
        a:hover {
          color: #ff680d !important;
        }
        :first-child {
          margin-left: 0;
        }
        a:hover,
        a:visited,
        a:link,
        a:active {
          color: rgba(0, 0, 0, 0.9);
        }
      }
    }
  }
}
</style>