2
This commit is contained in:
parent
3da46ccfee
commit
43013b712b
@ -5,3 +5,10 @@ export const getRegion = (params) => request.basic.get('/region', params)
|
||||
|
||||
// 获取 验证码ID
|
||||
export const getCaptcha = (params) => request.basic.get('/api/v1/captcha/id', params)
|
||||
|
||||
//上传图片
|
||||
export const uploadFile=(params)=>request.basic.post('/api/v1/upload',params,{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
})
|
||||
@ -106,9 +106,6 @@ const handlePreview = async (file) => {
|
||||
|
||||
// 修改handleChange方法
|
||||
const handleChange = ({ file, fileList: updatedList }) => {
|
||||
console.log(111)
|
||||
console.log(file.status)
|
||||
console.log(updatedList)
|
||||
// 处理上传成功的情况
|
||||
if (file.status === 'done') {
|
||||
const response = file.response;
|
||||
@ -145,7 +142,7 @@ const handleCustomRequest = async (options) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
const { data } = await apis.common.uploadImg(formData);
|
||||
const { data } = await apis.common.uploadFile(formData);
|
||||
const fullUrl = config('http.apiBasic') + data;
|
||||
|
||||
// 正确构造文件对象
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user