proxy cropper url (#4525)

This commit is contained in:
MeiMei 2019-03-18 16:41:29 +09:00 committed by syuilo
parent c2eec272e6
commit 681f372889
1 changed files with 9 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<template #header><fa icon="crop"/>{{ title }}</template>
<div class="body">
<vue-cropper ref="cropper"
:src="image.url"
:src="imageUrl"
:view-mode="1"
:aspect-ratio="aspectRatio"
:container-style="{ width: '100%', 'max-height': '400px' }"
@ -21,6 +21,7 @@
import Vue from 'vue';
import i18n from '../../../i18n';
import VueCropper from 'vue-cropperjs';
import * as url from '../../../../../prelude/url';
export default Vue.extend({
i18n: i18n('desktop/views/components/crop-window.vue'),
@ -41,6 +42,13 @@ export default Vue.extend({
required: true
}
},
computed: {
imageUrl() {
return `/proxy/?${url.query({
url: this.image.url
})}`;
},
},
methods: {
ok() {
(this.$refs.cropper as any).getCroppedCanvas().toBlob(blob => {