This commit is contained in:
jeremygan2021
2026-03-10 14:05:37 +08:00
parent 3d74ccc04f
commit 880192c358
9 changed files with 254 additions and 45 deletions

View File

@@ -79,12 +79,17 @@ export const getProjectDetail = (id: number) => request({ url: `/competition/pro
export const createProject = (data: any) => request({ url: '/competition/projects/', method: 'POST', data })
export const updateProject = (id: number, data: any) => request({ url: `/competition/projects/${id}/`, method: 'PATCH', data })
export const submitProject = (id: number) => request({ url: `/competition/projects/${id}/submit/`, method: 'POST' })
export const uploadProjectFile = (filePath: string) => {
export const getComments = (params: any) => request({ url: '/competition/comments/', data: params })
export const uploadProjectFile = (filePath: string, projectId: number, fileName?: string) => {
const BASE_URL = (typeof process !== 'undefined' && process.env && process.env.TARO_APP_API_URL) || 'https://market.quant-speed.com/api'
return Taro.uploadFile({
url: `${BASE_URL}/competition/files/`,
filePath,
name: 'file',
formData: {
project: projectId,
name: fileName || ''
},
header: {
'Authorization': `Bearer ${Taro.getStorageSync('token')}`
}