Parcourir la source

自定义配置标题信息

wang_xy il y a 2 ans
Parent
commit
3cb0d48ed7

+ 1 - 1
src/api/login.js

@@ -73,7 +73,7 @@ export function getCodeImg() {
 //获取登录页基本信息
 export function fontConfig() {
   return request({
-    url: '/system/fontConfig/getSysFontConfig/Forest',
+    url: '/system/fontConfig/getSysFontConfig/Water',
     method: 'get',
   })
 }

+ 8 - 0
src/api/system/config.js

@@ -58,3 +58,11 @@ export function refreshCache() {
     method: 'delete'
   })
 }
+
+//获取配置信息
+export function selectConfigKey(configKey) {
+  return request({
+    url: '/system/config/selectConfigKey/' + configKey,
+    method: 'get'
+  })
+}

+ 4 - 8
src/components/v-fastmenu.vue

@@ -39,6 +39,7 @@
 <script>
 import resetPwd from "../views/system/user/profile/resetPwd";
 import { getUserProfile } from "@/api/system/user";
+import { selectConfigKey } from "@/api/system/config";
 	export default {
     components: {resetPwd },
 		data() {
@@ -70,14 +71,9 @@ import { getUserProfile } from "@/api/system/user";
     },
 		methods: {
       backToMainPage(){
-        let href = window.location.href
-        let protacal = href.substr(0,href.indexOf("://")+3)
-        let mo = href.lastIndexOf(":") > 6  ? href.lastIndexOf(":") : href.lastIndexOf("/")
-        let ip = href.substr(href.indexOf("://")+3,mo);
-        let url =href.substr(0,mo)
-        // let toUrl = url +":15001/newpage"
-        let toUrl = "http://10.6.52.1:15001/newpage"
-        window.location.href = toUrl
+        selectConfigKey('backToMainPage').then(res => {
+          window.location.href = res.data;
+        })
       },
       getUser(){
         getUserProfile().then(response => {

+ 13 - 2
src/components/v-header.vue

@@ -5,7 +5,7 @@
 		<!--中间LOGO -->
 		<div class="title">
 			<!-- <img src="@/assets/images/integrated/bigdata-header-nav-left2.png" /> -->
-			<h3><img class="logo" src="@/assets/images/integrated/logo-small.png" />通榆县乡村振兴监管平台 {{titlename}}
+			<h3><img class="logo" src="@/assets/images/integrated/logo-small.png" />{{ systemTitle.title }} {{titlename}}
 			</h3>
 			<!-- <img src="@/assets/images/integrated/bigdata-header-nav-right2.png" /> -->
 		</div>
@@ -28,6 +28,7 @@
 	import {constantRoutes} from '@/router/index'//navbar导航引用了router路由的数组
 	import Clock from '@/components/clock.vue' // 时钟+天气
 	import VfastMenu from '@/components/v-fastmenu.vue' // 头部右侧菜单
+	import {fontConfig} from '@/api/login' // 头部右侧菜单
 	export default{
 		components:{
 			VfastMenu,
@@ -36,13 +37,23 @@
 		},
 		created(){
 			this.navbar
+      this.fontConfig()
 		},
 		data(){
 			return{
-
+        systemTitle: {
+          title: '',  //标题
+          subTitle: ''//副标题 数字林业
+        }
 			}
 		},
 		methods:{
+      fontConfig() {
+        fontConfig().then(res => {
+          this.systemTitle.title = res.data.fontTitle
+          this.systemTitle.subTitle = res.data.subTitle
+        })
+      }
 		},
 		computed:{
 			titlename(){

+ 13 - 2
src/views/bigdata/bigdata.vue

@@ -5,7 +5,7 @@
     <div class="header">
       <!-- title -->
       <div class="header-left"><img class="logo" src="@/assets/images/integrated/logo-small.png"/>
-        <h3 class="title">通榆县乡村振兴监管平台-数字水利-统计分析</h3>
+        <h3 class="title">{{ systemTitle.title }}-{{ systemTitle.subTitle }}-统计分析</h3>
       </div>
       <div class="bignav">
         <img src="@/assets/images/integrated/bigdata-header-nav-left.png"/>
@@ -201,6 +201,7 @@ import chartPitG5 from './chart-farmtype' //21 偷钓偷捕事件分析、、
 import chartPitG6 from './chart-waterTotal' //22 水利事件分析、、
 
 import {getRlt} from '@/api/bigdata'
+import { fontConfig } from '@/api/login'
 
 export default {
   components: {
@@ -230,6 +231,10 @@ export default {
   data() {
 
     return {
+      systemTitle: {
+        title: '', //标题
+        subTitle: '' //副标题
+      },
       visited: '',
       navbar: [
         {
@@ -282,8 +287,13 @@ export default {
 
     }
   },
-
   methods:{
+    fontConfig() {
+      fontConfig().then(res => {
+        this.systemTitle.title = res.data.fontTitle
+        this.systemTitle.subTitle = res.data.subTitle
+      })
+    },
     rlt() {
       let that = this
       getRlt().then(resp => {
@@ -295,6 +305,7 @@ export default {
     }
   },
   mounted() {
+    this.fontConfig();
     this.rlt()
   }
 }