seimin 1 year ago
parent
commit
e340b49648
4 changed files with 33 additions and 4 deletions
  1. 1 1
      public/index.html
  2. 13 2
      src/components/AppHeader.vue
  3. 18 0
      src/http/http.js
  4. 1 1
      src/router/index.js

+ 1 - 1
public/index.html

@@ -4,7 +4,7 @@
4
     <meta charset="utf-8">
4
     <meta charset="utf-8">
5
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
5
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
6
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
7
+    <link rel="icon" id="favicon" href="<%= BASE_URL %>favicon.ico">
8
     <title><%= htmlWebpackPlugin.options.title %></title>
8
     <title><%= htmlWebpackPlugin.options.title %></title>
9
   </head>
9
   </head>
10
   <body>
10
   <body>

+ 13 - 2
src/components/AppHeader.vue

@@ -7,8 +7,8 @@
7
       <div class="app-header__main--leftBottom"></div>
7
       <div class="app-header__main--leftBottom"></div>
8
       <div class="app-header__main--rightBottom"></div>
8
       <div class="app-header__main--rightBottom"></div>
9
       <h1 class="app-header__title">
9
       <h1 class="app-header__title">
10
-        <img class="app-header__logo" src="./../assets/img/logo.png" />
11
-        大势输送保障管理平台
10
+        <img class="app-header__logo" :src="logoUrl" />
11
+        {{logoTitle}}
12
       </h1>
12
       </h1>
13
     </div>
13
     </div>
14
     <!-- /头部线条及标题 -->
14
     <!-- /头部线条及标题 -->
@@ -35,6 +35,7 @@
35
 </template>
35
 </template>
36
 
36
 
37
 <script>
37
 <script>
38
+import { get } from './../http/http'
38
 import AppToday from './AppToday'
39
 import AppToday from './AppToday'
39
 import AppCumulative from './AppCumulative'
40
 import AppCumulative from './AppCumulative'
40
 export default {
41
 export default {
@@ -96,10 +97,20 @@ export default {
96
         this.time = Date.now()
97
         this.time = Date.now()
97
         this.runTime()
98
         this.runTime()
98
       }, 500)
99
       }, 500)
100
+    },
101
+    getSysNameAndLogo () {
102
+      get('/auth/getSysNameAndLogo')
103
+        .then((result) => {
104
+          this.logoTitle = result.largeScreenName || ''
105
+          this.logoUrl = result.favicon || ''
106
+          document.querySelector('#favicon').href = result.favicon || ''
107
+          document.title = this.logoTitle
108
+        })
99
     }
109
     }
100
   },
110
   },
101
   mounted () {
111
   mounted () {
102
     this.runTime()
112
     this.runTime()
113
+    this.getSysNameAndLogo()
103
   },
114
   },
104
   beforeDestroy () {
115
   beforeDestroy () {
105
     clearTimeout(this.timer)
116
     clearTimeout(this.timer)

+ 18 - 0
src/http/http.js

@@ -32,3 +32,21 @@ export function post (url, data = {}) {
32
       })
32
       })
33
   })
33
   })
34
 }
34
 }
35
+
36
+// get请求
37
+export function get (url, data = {}) {
38
+  url = path + url
39
+  return new Promise((resolve, reject) => {
40
+    axios({
41
+      method: 'get',
42
+      url,
43
+      data
44
+    })
45
+      .then(res => {
46
+        resolve(res.data)
47
+      })
48
+      .catch(err => {
49
+        reject(err)
50
+      })
51
+  })
52
+}

+ 1 - 1
src/router/index.js

@@ -17,7 +17,7 @@ const router = new VueRouter({
17
 })
17
 })
18
 router.beforeEach((to, from, next) => {
18
 router.beforeEach((to, from, next) => {
19
   if (to.meta.title) {
19
   if (to.meta.title) {
20
-    document.title = document.title = to.meta.title + ' - 大势医院输送保障管理平台'
20
+    // document.title = document.title = to.meta.title + ' - 大势医院输送保障管理平台'
21
   }
21
   }
22
   next()
22
   next()
23
 })
23
 })