修改上传图片接口,登录页加记住密码
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user