修改上传图片接口,登录页加记住密码

This commit is contained in:
zhouyanli
2026-05-28 10:31:38 +08:00
parent 53c4a37854
commit c8c6b7f922
5 changed files with 74 additions and 24 deletions

View File

@@ -150,14 +150,15 @@ const uploadImages = async () => {
continue
}
try {
const res = await uploadFile(path)
// 根据后端实际返回结构调整字段名
uploadedUrls.push(res.url || '')
// 从路径中提取文件名
const fileName = path.substring(path.lastIndexOf('/') + 1)
const res = await uploadFile(path, fileName)
uploadedUrls.push(res?.url || '')
} catch (err) {
uni.showToast({
title:err.msg || '图片上传失败',
icon:'error'
})
uni.showToast({
title: err.msg || '图片上传失败',
icon: 'error'
})
}
}
return uploadedUrls