Skip to content

Commit

Permalink
[add] custom avatar image thumb size
Browse files Browse the repository at this point in the history
  • Loading branch information
VecHK committed Jan 6, 2024
1 parent f7e65ff commit 56c4a12
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
19 changes: 15 additions & 4 deletions dashboard/src/components/UploadImageBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
drag
:name="uploadName"
:headers="headers"
:action="uploadUrl"
:action="upload_url"
:show-file-list="false"
:on-error="uploadError"
:on-progress="uploadProgress"
Expand Down Expand Up @@ -137,9 +137,9 @@
default: ''
},
uploadUrl: {
type: String,
default: `${process.env.VUE_APP_BASE_API}admin/image/upload`
width: {
type: Number,
default: 0
},
previewUrl: {
Expand All @@ -161,6 +161,17 @@
percent: 0
}),
computed: {
upload_url() {
const base_url = `${process.env.VUE_APP_BASE_API}admin/image/upload`
if (this.width !== 0) {
return `${base_url}?width=${this.width}`
} else {
return base_url
}
}
},
methods: {
resetUploading() {
this.uploading = false
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/views/member/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
>
<UploadImageBox
ref="UploadImageBox"
:width="128"
:preview-url="preview_url"
@upload-success="uploadSuccess"
/>
Expand Down

0 comments on commit 56c4a12

Please sign in to comment.