mirror of
https://github.com/doocs/md.git
synced 2024-11-28 13:36:32 +08:00
upload image fix
This commit is contained in:
parent
0abb90cb4f
commit
779760b281
@ -131,7 +131,7 @@ export default {
|
||||
data.append('file', pasteFile)
|
||||
|
||||
fileApi.fileUpload(data).then(res => {
|
||||
this.uploaded(res.data)
|
||||
this.uploaded(res)
|
||||
}).catch(err => {
|
||||
console.log(err.message)
|
||||
})
|
||||
|
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<el-container class="top">
|
||||
<!-- 图片上传 -->
|
||||
<el-upload class="header__item" action="https://imgkr.com/api/files/upload" :headers="{'Content-Type': 'multipart/form-data'}"
|
||||
<el-upload class="header__item" action="https://imgkr.com/api/files/upload"
|
||||
:headers="{'Content-Type': 'multipart/form-data'}"
|
||||
:show-file-list="false" :multiple="true" accept=".jpg,.jpeg,.png,.gif" name="file"
|
||||
:before-upload="beforeUpload" :on-success="uploaded">
|
||||
<el-tooltip effect="dark" content="上传图片" placement="bottom-start">
|
||||
@ -69,6 +70,7 @@ import {
|
||||
setFontSize,
|
||||
isImageIllegal
|
||||
} from '../../scripts/util'
|
||||
import fileApi from '../../api/file';
|
||||
import {
|
||||
solveWeChatImage,
|
||||
solveHtml
|
||||
@ -165,7 +167,15 @@ export default {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
let fd = new FormData();
|
||||
|
||||
fd.append('file', file);
|
||||
fileApi.fileUpload(fd).then(res => {
|
||||
this.uploaded(res)
|
||||
}).catch(err => {
|
||||
console.log(err.message)
|
||||
})
|
||||
return false;
|
||||
},
|
||||
// 复制到微信公众号
|
||||
copy() {
|
||||
|
Loading…
Reference in New Issue
Block a user