| | |
| | | : BASE.API_PROD.common; |
| | | // 文件上传接口 |
| | | export const uploadFile = commonUrl + "/common/common/upload/file"; |
| | | |
| | | export const uploadFile2 = commonUrl + "/common/lmk/file/upload"; |
| | | |
| | | var isRefreshToken = 0; |
| | | const refreshToken = getTokenDebounce(); |
| | | const service = axios.create({ |
| | |
| | | return service(data); |
| | | }; |
| | | |
| | | export const postRequest2 = (url, params, headers) => { |
| | | let accessToken = getStore("accessToken"); |
| | | return service({ |
| | | method: "post", |
| | | url, |
| | | data: params, // 直接传对象,不要用 [params] 包装 |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const postRequest = (url, params, headers) => { |
| | | let accessToken = getStore("accessToken"); |
| | | return service({ |
| | |
| | | } |
| | | }); |
| | | }; |
| | | export const putRequest2 = (url, params, headers) => { |
| | | let accessToken = getStore("accessToken"); |
| | | return service({ |
| | | method: "put", |
| | | url, |
| | | data: params, // 直接传对象,不要用 [params] 包装 |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const putRequestWithNoForm = (url, params) => { |
| | | let accessToken = getStore("accessToken"); |
| | |
| | | }); |
| | | }; |
| | | |
| | | export const uploadFileRequest2 = (url, params) => { |
| | | let accessToken = getStore("accessToken"); |
| | | return axios({ // 直接使用 axios,而不是 service(避免 baseUrl 影响) |
| | | method: "post", |
| | | url: `${url}`, // 直接传完整 URL,如 uploadFile |
| | | data: params, |
| | | headers: { |
| | | accessToken: accessToken, |
| | | 'Content-Type': 'multipart/form-data' |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | export const delFileByFileKeyRequest = (url, params) => { |
| | | let accessToken = getStore("accessToken"); |
| | | return axios({ // 直接使用 axios,而不是 service(避免 baseUrl 影响) |
| | | method: "DELETE", |
| | | url: `${url}` + '/'+params, // 直接传完整 URL,如 uploadFile |
| | | headers: { |
| | | accessToken: accessToken, |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | |
| | | /** |