perf: 优化分享界面的自定义网盘logo

This commit is contained in:
jmal 2022-08-29 23:57:46 +08:00
parent 1578c38026
commit 0679f915a0
2 changed files with 21 additions and 4 deletions

View File

@ -35,6 +35,7 @@ export default {
if (!value) { if (!value) {
return return
} }
console.log('value', value)
this.setLogUrl(value) this.setLogUrl(value)
}, },
immediate: true, immediate: true,

View File

@ -6,8 +6,8 @@
<div class="share-h"> <div class="share-h">
<div class="share-header"> <div class="share-header">
<div class="share-header-content logo"> <div class="share-header-content logo">
<svg-icon icon-class="jmal-cloud"/> <Logo v-model="netdiskLogo" width="35"></Logo>
<span>jmalcloud</span> <span>{{ netdiskName }}</span>
</div> </div>
<div class="share-header-content sharer"> <div class="share-header-content sharer">
<span><span class="user">{{sharer.showName}}</span>的分享</span> <span><span class="user">{{sharer.showName}}</span>的分享</span>
@ -243,8 +243,10 @@
import fileConfig from "@/utils/file-config"; import fileConfig from "@/utils/file-config";
import Clipboard from "clipboard"; import Clipboard from "clipboard";
import OfficePreview from "@/components/preview/OfficePreview"; import OfficePreview from "@/components/preview/OfficePreview";
import Logo from "@/components/Logo";
export default { export default {
components: { components: {
Logo,
OfficePreview, IconFile, BreadcrumbFilePath,AlLoading, OfficePreview, IconFile, BreadcrumbFilePath,AlLoading,
AudioPreview, VideoPreview, ImageViewer, SimTextPreview AudioPreview, VideoPreview, ImageViewer, SimTextPreview
}, },
@ -363,13 +365,21 @@
showUpdateDateItem: this.$pc,// 列表模式下是否显示修改时间 showUpdateDateItem: this.$pc,// 列表模式下是否显示修改时间
showSizeItem: this.$pc,// 列表模式下是否显示文件大小 showSizeItem: this.$pc,// 列表模式下是否显示文件大小
sharer: {},//分享者信息 sharer: {},//分享者信息
sharerAvatarUrl: '' sharerAvatarUrl: '',
netdiskName: 'JmalCloud',
netdiskLogo: ''
} }
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'name' 'name'
]) ]),
netdiskLogo() {
if (this.$store.state.user.netdiskLogo) {
return this.$store.state.user.netdiskLogo
}
return ''
}
}, },
created() { created() {
this.getFileList() this.getFileList()
@ -563,6 +573,12 @@
api.getSharer({userId: this.fileList[0].userId}).then(res => { api.getSharer({userId: this.fileList[0].userId}).then(res => {
this.sharer = res.data this.sharer = res.data
this.sharerAvatarUrl = this.imageUrl + res.data.avatar this.sharerAvatarUrl = this.imageUrl + res.data.avatar
if (this.sharer.netdiskName) {
this.netdiskName = this.sharer.netdiskName
}
if (this.sharer.netdiskLogo) {
this.netdiskLogo = this.sharer.netdiskLogo
}
}) })
} }
this.loadClientHeight() this.loadClientHeight()