刷新时间
This commit is contained in:
@@ -33,8 +33,8 @@
|
||||
<button v-show="showBtn1" class="iconfont login_icon delete_icon" @click="clearData(1)"></button>
|
||||
</div>
|
||||
<div class="inputOuter">
|
||||
<!-- <input type="text" placeholder="图片域名地址" class="inputStyle" v-model="imgBaseUrl">
|
||||
<button v-show="showBtn2" class="iconfont login_icon delete_icon" @click="clearData(2)"></button> -->
|
||||
<input type="number" placeholder="刷新时间(秒)" class="inputStyle" v-model="setTime">
|
||||
<button v-show="showBtn2" class="iconfont login_icon delete_icon" @click="clearData(2)"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="submit">
|
||||
@@ -57,6 +57,7 @@ export default {
|
||||
password: '',
|
||||
baseUrl: this.$store.getters.baseUrl,
|
||||
imgBaseUrl: this.$store.getters.imgBaseUrl,
|
||||
setTime: this.$store.getters.setTime / 1000,
|
||||
inputType: 'password',
|
||||
eyeOpen: true,
|
||||
drift: 0,
|
||||
@@ -71,7 +72,7 @@ export default {
|
||||
return this.baseUrl !== ''
|
||||
},
|
||||
showBtn2 () {
|
||||
return this.imgBaseUrl !== ''
|
||||
return this.setTime !== ''
|
||||
},
|
||||
showBtn3 () {
|
||||
return this.loginname !== ''
|
||||
@@ -126,7 +127,7 @@ export default {
|
||||
this.baseUrl = ''
|
||||
break
|
||||
case 2:
|
||||
this.imgBaseUrl = ''
|
||||
this.setTime = ''
|
||||
break
|
||||
case 3:
|
||||
this.loginname = ''
|
||||
@@ -144,7 +145,7 @@ export default {
|
||||
_config () {
|
||||
let obj = {
|
||||
baseUrl: this.baseUrl,
|
||||
imgBaseUrl: this.imgBaseUrl
|
||||
setTime: this.setTime * 1000
|
||||
}
|
||||
this.$store.dispatch('setConfig', obj)
|
||||
this._tabChange(0)
|
||||
|
||||
@@ -5,6 +5,7 @@ const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.155:
|
||||
const imgBaseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.100/' : 'http://192.168.46.5/'
|
||||
const state = {
|
||||
baseUrl: getStore('baseUrl') || baseUrl,
|
||||
setTime: getStore('setTime') || 5000,
|
||||
imgBaseUrl: getStore('imgBaseUrl') || imgBaseUrl,
|
||||
lockTime: getStore('lockTime') || 0,
|
||||
loading: false,
|
||||
@@ -18,6 +19,7 @@ const state = {
|
||||
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
setTime: state => state.setTime,
|
||||
imgBaseUrl: state => state.imgBaseUrl,
|
||||
lockTime: state => state.lockTime,
|
||||
loading: state => state.loading,
|
||||
@@ -28,6 +30,7 @@ const getters = {
|
||||
const actions = {
|
||||
setConfig ({commit}, res) {
|
||||
setStore('baseUrl', res.baseUrl)
|
||||
setStore('setTime', res.setTime)
|
||||
setStore('imgBaseUrl', res.imgBaseUrl)
|
||||
setStore('lockTime', res.lockTime)
|
||||
commit(types.COM_CONFIG, res)
|
||||
@@ -58,6 +61,7 @@ const actions = {
|
||||
const mutations = {
|
||||
[types.COM_CONFIG] (state, res) {
|
||||
state.baseUrl = res.baseUrl
|
||||
state.setTime = res.setTime
|
||||
state.imgBaseUrl = res.imgBaseUrl
|
||||
state.lockTime = res.lockTime
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user