<el-upload
:action="oss.host"
:data="oss"
list-type="picture-card"
:file-list="fileList"
:on-success="handleSuccess"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i class="el-icon-plus"></i>
</el-upload>
export default {
mounted() {
$http.api("Ipcontent/getPolicy", {}, (s, data, i) => {
if (s != 1) return this.$alert(i);
let { dir, host, policy, signature, callback, accessid } = data;
this.oss.key = dir + this.$dateFormat(new Date() ,'YYYYMMDDHHmmss') + "${filename}";
this.oss.host = host;
this.oss.policy = policy;
this.oss.Signature = signature;
this.oss.callback = callback;
this.oss.OSSAccessKeyId = accessid;
});
},
data(){
return {
oss: {
key: "",
policy: "",
Signature: "",
host: "",
success_action_status: 200,
callback: ""
},
}
}
}
网友评论