比赛
This commit is contained in:
@@ -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')}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user