Skip to content

Commit

Permalink
fix: 修复文件上传接口不包含token的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
asforest committed Dec 10, 2024
1 parent a2c202b commit d8119d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/fs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import instance from "@/utils/request.js";
import axios from "axios";
import store from "@/store/index.js";

export const fsDiskInfoRequest = () => instance.post('/fs/disk-info', {})

Expand All @@ -14,6 +15,7 @@ export const fsSignFileRequest = (path = '') => instance.post('/fs/sign-file', {
export const fsUploadRequest = (path = '', file, onProgress) => {
return axios.post(`${import.meta.env.VITE_API_URL}/fs/upload`, file, {
headers: {
'Token': store.getState().user.token,
'Content-Type': 'application/octet-stream',
'Path': encodeURIComponent(path)
},
Expand Down

0 comments on commit d8119d7

Please sign in to comment.