Merge pull request #1945 from dataease/pr@dev@feat_mobile_bg
feat: 增加移动端背景替换
This commit is contained in:
commit
8796df4904
@ -84,3 +84,6 @@ CREATE TABLE `de_engine` (
|
|||||||
`status` varchar(45) DEFAULT NULL COMMENT '状态',
|
`status` varchar(45) DEFAULT NULL COMMENT '状态',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.mobileBG', NULL, 'file', 0);
|
||||||
|
|||||||
@ -1888,7 +1888,8 @@ export default {
|
|||||||
cmonth: 'This Month',
|
cmonth: 'This Month',
|
||||||
cquarter: 'This Quarter',
|
cquarter: 'This Quarter',
|
||||||
cyear: 'This Year',
|
cyear: 'This Year',
|
||||||
openHomePage: 'Show Home Page'
|
openHomePage: 'Show Home Page',
|
||||||
|
mobileBG: 'Mobile BG'
|
||||||
},
|
},
|
||||||
dynamic_year: {
|
dynamic_year: {
|
||||||
fix: 'Fixed Year',
|
fix: 'Fixed Year',
|
||||||
|
|||||||
@ -1641,7 +1641,9 @@ export default {
|
|||||||
themeLight: '淺色',
|
themeLight: '淺色',
|
||||||
themeDark: '深色',
|
themeDark: '深色',
|
||||||
themeCustom: '自定義',
|
themeCustom: '自定義',
|
||||||
openHomePage: '顯示首頁'
|
openHomePage: '顯示首頁',
|
||||||
|
|
||||||
|
mobileBG: '移動端背景'
|
||||||
|
|
||||||
},
|
},
|
||||||
auth: {
|
auth: {
|
||||||
|
|||||||
@ -1650,7 +1650,8 @@ export default {
|
|||||||
themeLight: '浅色',
|
themeLight: '浅色',
|
||||||
themeDark: '深色',
|
themeDark: '深色',
|
||||||
themeCustom: '自定义',
|
themeCustom: '自定义',
|
||||||
openHomePage: '显示首页'
|
openHomePage: '显示首页',
|
||||||
|
mobileBG: '移动端背景'
|
||||||
|
|
||||||
},
|
},
|
||||||
auth: {
|
auth: {
|
||||||
|
|||||||
@ -43,3 +43,10 @@ export function validate(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getUIinfo() {
|
||||||
|
return request({
|
||||||
|
url: '/system/ui/info',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view
|
||||||
|
v-if="axiosFinished"
|
||||||
|
:class="mobileBG ? 'content-de' : 'content'"
|
||||||
|
:style="mobileBG ? {background:'url(' + mobileBG + ') no-repeat', 'backgroundSize':'cover'} : ''"
|
||||||
|
>
|
||||||
|
|
||||||
<view class="input-group" >
|
<view class="input-group" >
|
||||||
<view class="input-row">
|
<view class="input-row">
|
||||||
@ -28,7 +32,7 @@
|
|||||||
mapMutations
|
mapMutations
|
||||||
} from 'vuex'
|
} from 'vuex'
|
||||||
import mInput from '../../components/m-input.vue'
|
import mInput from '../../components/m-input.vue'
|
||||||
import {login, getInfo, getPublicKey } from '@/api/auth'
|
import {login, getInfo, getPublicKey, getUIinfo } from '@/api/auth'
|
||||||
import {encrypt, setLocalPK, getLocalPK, setToken, getToken, setUserInfo, getUserInfo } from '@/common/utils'
|
import {encrypt, setLocalPK, getLocalPK, setToken, getToken, setUserInfo, getUserInfo } from '@/common/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -39,19 +43,25 @@
|
|||||||
return {
|
return {
|
||||||
username: '',
|
username: '',
|
||||||
loginBtnLoading: false,
|
loginBtnLoading: false,
|
||||||
password: ''
|
password: '',
|
||||||
|
mobileBG: null,
|
||||||
|
axiosFinished: false
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapState(['forcedLogin', 'hasLogin', 'univerifyErrorMsg', 'hideUniverify']),
|
computed: mapState(['forcedLogin', 'hasLogin', 'univerifyErrorMsg', 'hideUniverify']),
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: this.$t('commons.loading')
|
||||||
|
});
|
||||||
|
this.loadUiInfo()
|
||||||
this.loadPublicKey()
|
this.loadPublicKey()
|
||||||
if(getToken() && getUserInfo()) {
|
if(getToken() && getUserInfo()) {
|
||||||
this.toMain()
|
this.toMain()
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['login']),
|
...mapMutations(['login']),
|
||||||
|
|
||||||
@ -105,6 +115,25 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadUiInfo() {
|
||||||
|
getUIinfo().then(res => {
|
||||||
|
|
||||||
|
|
||||||
|
const list = res.data
|
||||||
|
list.forEach(item => {
|
||||||
|
if(item.paramKey === 'ui.mobileBG' && item.paramValue) {
|
||||||
|
this.mobileBG = '/system/ui/image/' + item.paramValue
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
this.axiosFinished = true
|
||||||
|
}, 1500)
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
loadPublicKey() {
|
loadPublicKey() {
|
||||||
if(!getLocalPK()) {
|
if(!getLocalPK()) {
|
||||||
@ -187,6 +216,18 @@
|
|||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content-de {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: #000000;
|
||||||
|
padding: 10px;
|
||||||
|
justify-content: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
.input-group {
|
.input-group {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
|||||||
@ -6,7 +6,9 @@ module.exports = {
|
|||||||
title: 'DataEase',
|
title: 'DataEase',
|
||||||
WHITE_LIST: [
|
WHITE_LIST: [
|
||||||
'/api/auth/login',
|
'/api/auth/login',
|
||||||
'/api/auth/getPublicKey'
|
'/api/auth/getPublicKey',
|
||||||
|
'/system/ui/info',
|
||||||
|
'/system/ui/image/'
|
||||||
|
|
||||||
],
|
],
|
||||||
RECENT_KEY: 'recently',
|
RECENT_KEY: 'recently',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user