فهرست منبع

登录页面获取数据

wang_xy 2 سال پیش
والد
کامیت
4f8b3f9037
2فایلهای تغییر یافته به همراه22 افزوده شده و 5 حذف شده
  1. 9 1
      src/api/login.js
  2. 13 4
      src/views/system/login.vue

+ 9 - 1
src/api/login.js

@@ -58,4 +58,12 @@ export function getCodeImg() {
     method: 'get',
     timeout: 20000
   })
-}
+}
+
+//获取登录页基本信息
+export function fontConfig() {
+  return request({
+    url: '/system/fontConfig/getSysFontConfig/Agriculture',
+    method: 'get',
+  })
+}

+ 13 - 4
src/views/system/login.vue

@@ -47,7 +47,8 @@
 <script>
 	import StarBackground from '@/components/star'
 	import {
-		getCodeImg
+		getCodeImg,
+    fontConfig
 	} from '@/api/login'
 	import Cookies from 'js-cookie'
 	import {
@@ -66,7 +67,7 @@
 		data() {
 			return {
 				backgroudImg:require('../../assets/images/login/login-ty.jpg'), //背景图片
-			    systemTitle:{
+        systemTitle:{
 					title:'通榆县乡村振兴综合监管平台',  //标题
 					subTitle:'数字农业'  ,//副标题
 				},
@@ -112,10 +113,18 @@
 			}
 		},
 		created() {
-			this.getCode()
-			this.getCookie()
+			this.getCode();
+			this.getCookie();
+			this.fontConfig();
 		},
 		methods: {
+      fontConfig(){
+        fontConfig().then(res => {
+          this.systemTitle.title = res.data.fontTitle;
+          this.systemTitle.subTitle = res.data.subTitle;
+          this.backgroudImg = res.data.picUrl;
+        })
+      },
 			getCode() {
 				getCodeImg().then(res => {
 					this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff