diff --git a/app/other/apis/file.go b/app/other/apis/file.go index 9f47d30..0aadb12 100644 --- a/app/other/apis/file.go +++ b/app/other/apis/file.go @@ -101,8 +101,8 @@ func (e File) baseImg(c *gin.Context, fileResponse FileResponse, urlPerfix strin return fileResponse } if source != "1" { - fileResponse.Path = "https://youshikeji.oss-cn-shanghai.aliyuncs.com/img/" + fileName - fileResponse.FullPath = "https://youshikeji.oss-cn-shanghai.aliyuncs.com/img/" + fileName + fileResponse.Path = "/static/uploadfile/" + fileName + fileResponse.FullPath = "/static/uploadfile/" + fileName } return fileResponse } @@ -135,8 +135,8 @@ func (e File) multipleFile(c *gin.Context, urlPerfix string) []FileResponse { Type: fileType, } if source != "1" { - fileResponse.Path = "https://youshikeji.oss-cn-shanghai.aliyuncs.com/img/" + fileName - fileResponse.FullPath = "https://youshikeji.oss-cn-shanghai.aliyuncs.com/img/" + fileName + fileResponse.Path = "/static/uploadfile/" + fileName + fileResponse.FullPath = "/static/uploadfile/" + fileName } multipartFile = append(multipartFile, fileResponse) } @@ -171,14 +171,14 @@ func (e File) singleFile(c *gin.Context, fileResponse FileResponse, urlPerfix st Name: files.Filename, Type: fileType, } - source, _ := c.GetPostForm("source") - err = thirdUpload(source, fileName, singleFile) - if err != nil { - e.Error(200, errors.New(""), "上传第三方失败") - return FileResponse{}, true - } - fileResponse.Path = "https://youshikeji.oss-cn-shanghai.aliyuncs.com/img/" + fileName - fileResponse.FullPath = "https://youshikeji.oss-cn-shanghai.aliyuncs.com/img/" + fileName + //source, _ := c.GetPostForm("source") + //err = thirdUpload(source, fileName, singleFile) + //if err != nil { + // e.Error(200, errors.New(""), "上传第三方失败") + // return FileResponse{}, true + //} + fileResponse.Path = "/static/uploadfile/" + fileName + fileResponse.FullPath = "/static/uploadfile/" + fileName return fileResponse, false } @@ -200,4 +200,4 @@ func ossUpload(name string, path string) error { func qiniuUpload(name string, path string) error { oss := file_store.ALiYunOSS{} return oss.UpLoad(name, path) -} +} \ No newline at end of file