feat: add upload image payback

This commit is contained in:
caturbgs
2021-12-21 14:42:53 +07:00
parent 89b890c888
commit a4ba756dbc
3 changed files with 106 additions and 135 deletions

View File

@@ -50,13 +50,16 @@ export const http = {
return req;
},
upload: (file) => {
const request = superagent
.post(appConfig.apiUrl + '/files')
let req = superagent
.post(appConfig.apiUrl + '/config/upload-files')
.attach('file', file)
.use(authIntercept)
.use(attachSuperagentLogger);
if (TokenUtil.accessToken) {
req = req.set('Authorization', 'Bearer ' + TokenUtil.accessToken);
}
return request;
return req;
},
uploadAntd: (args) => {
const file = args.file;