Commit 590c83b0 by hank

bug

parent e3bb6ab4
......@@ -12,9 +12,11 @@
:on-success="handleSuccess"
:before-upload="beforeUpload"
class="editor-slide-upload"
action="https://httpbin.org/post"
:action="uploadUrl"
name="resource"
list-type="picture-card"
>
<!-- https://httpbin.org/post -->
<el-button size="small" type="primary">
点击上传
</el-button>
......@@ -31,7 +33,7 @@
<script>
// import { getToken } from 'api/qiniu'
import { uploadUrl } from '@/api/device'
export default {
name: 'EditorSlideUpload',
props: {
......@@ -43,6 +45,7 @@ export default {
data() {
return {
dialogVisible: false,
uploadUrl: uploadUrl(),
listObj: {},
fileList: []
}
......@@ -63,11 +66,12 @@ export default {
this.dialogVisible = false
},
handleSuccess(response, file) {
console.log(response)
const uid = file.uid
const objKeyArr = Object.keys(this.listObj)
for (let i = 0, len = objKeyArr.length; i < len; i++) {
if (this.listObj[objKeyArr[i]].uid === uid) {
this.listObj[objKeyArr[i]].url = response.files.file
this.listObj[objKeyArr[i]].url = response.data
this.listObj[objKeyArr[i]].hasSuccess = true
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment