修复微信上传文件失败问题
This commit is contained in:
parent
9b069aeb99
commit
efc8485082
|
|
@ -38,13 +38,27 @@
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue'])
|
const emits = defineEmits(['update:modelValue'])
|
||||||
const images = ref(props.modelValue)
|
const images = ref(props.modelValue)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function uploadfile(par){
|
||||||
|
let file=null;
|
||||||
|
// #ifdef H5
|
||||||
|
file= par.file
|
||||||
|
// #endif
|
||||||
|
// #ifndef H5
|
||||||
|
file= par
|
||||||
|
// #endif
|
||||||
|
return $uploadFile(file)
|
||||||
|
}
|
||||||
|
|
||||||
function afterRead(e) {
|
function afterRead(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
if (Array.isArray(e)) {
|
if (Array.isArray(e.file)) {
|
||||||
for (let i in e.file) {
|
for (let i in e.file) {
|
||||||
const file = e.file[i].file
|
const file = e.file[i]
|
||||||
$uploadFile(file).then(res => {
|
console.log(file);
|
||||||
|
uploadfile(file).then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
images.value.push({
|
images.value.push({
|
||||||
url: e.file[i].url,
|
url: e.file[i].url,
|
||||||
|
|
@ -64,8 +78,7 @@
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
const i=0
|
const i=0
|
||||||
const file = e.file.file
|
uploadfile(e.file).then(res => {
|
||||||
$uploadFile(file).then(res => {
|
|
||||||
console.log(res);
|
console.log(res);
|
||||||
images.value.push({
|
images.value.push({
|
||||||
url: e.file.url,
|
url: e.file.url,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue