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

View file

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