fix #81, reset logo

This commit is contained in:
les
2020-07-19 22:13:23 +02:00
parent ca5cb474ba
commit 59811e580c

View File

@@ -32,7 +32,9 @@
accept='image/png' accept='image/png'
:limit='1' :limit='1'
:multiple='false') :multiple='false')
el-button(slot='trigger' size='small' type='primary' plain) Select file el-button-group
el-button(size='small' type='primary' plain) Select file
el-button(size='small' type='success' plain @click='resetLogo') Reset
.el-upload__tip(slot='tip') png files with a size less than 500kb .el-upload__tip(slot='tip') png files with a size less than 500kb
el-image(:src='`${settings.baseurl}/favicon.ico?${logoKey}`') el-image(:src='`${settings.baseurl}/favicon.ico?${logoKey}`')
el-switch.d-block.mt-4(v-model='allow_registration' el-switch.d-block.mt-4(v-model='allow_registration'
@@ -106,6 +108,11 @@ export default {
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
this.logoKey++ this.logoKey++
}, },
resetLogo (e) {
this.setSetting({ key: 'favicon', value: null })
.then(this.forceLogoReload)
e.stopPropagation()
},
save (key, value) { save (key, value) {
if (this.settings[key] !== value) { if (this.settings[key] !== value) {
this.setSetting({ key, value }) this.setSetting({ key, value })