...
|
...
|
@@ -9,7 +9,6 @@ |
|
|
:simultaneous-uploads="1"
|
|
|
:value="file"
|
|
|
@files-added="filesAdded"
|
|
|
@file-submitted="fileSubmit"
|
|
|
@file-error="fileError"
|
|
|
@file-success="fileSuccess"
|
|
|
@file-removed="fileRemove"
|
...
|
...
|
@@ -62,23 +61,23 @@ export default { |
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
let vm = this;
|
|
|
|
|
|
return {
|
|
|
multiple: false,
|
|
|
action: {
|
|
|
target: 'http://upload.qiniup.com/',
|
|
|
data: {
|
|
|
token: '',
|
|
|
key: ''
|
|
|
data(file) {
|
|
|
return {
|
|
|
token: vm.token,
|
|
|
key: 'license/' + Date.now() + '/' + file.name
|
|
|
};
|
|
|
}
|
|
|
},
|
|
|
file: this.value
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
fileSubmit(file) {
|
|
|
this.action.data.token = this.token;
|
|
|
this.action.data.key = 'license/' + Date.now() + '/' + file.name;
|
|
|
},
|
|
|
filesAdded(files) {
|
|
|
let hasIgnore = false;
|
|
|
const maxSize = 10 * 1024 * 1024; // 10M
|
...
|
...
|
@@ -126,10 +125,10 @@ export default { |
|
|
},
|
|
|
fileSuccess(file) {
|
|
|
file.name = file.response.key;
|
|
|
this.$emit('file-change');
|
|
|
this.$emit('file-change', file);
|
|
|
},
|
|
|
fileRemove(file) {
|
|
|
this.$emit('file-change');
|
|
|
this.$emit('file-change', file);
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
|