1 Star 0 Fork 1.1K

夏之记忆/萤火商城V2.0-uniapp端

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
upload.js 513 Bytes
一键复制 编辑 原始数据 按行查看 历史
萤火科技 提交于 2024-02-06 22:51 . v2.1.0
import request from '@/utils/request'
// api地址
const api = {
image: 'upload/image'
}
// 图片上传
export const image = (files, checkLogin = true) => {
// 文件上传大小, 2M
const maxSize = 1024 * 1024 * 2
// 执行上传
return new Promise((resolve, reject) => {
request.urlFileUpload({ name: 'file', files, maxSize, data: { test: 123, checkLogin: Number(checkLogin) } })
.then(result => resolve(result.map(item => item.data.fileInfo.file_id), result))
.catch(reject)
})
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/memories-of-xia/yoshop2.0-uniapp.git
git@gitee.com:memories-of-xia/yoshop2.0-uniapp.git
memories-of-xia
yoshop2.0-uniapp
萤火商城V2.0-uniapp端
master

搜索帮助