|
|
|
@ -12,6 +12,7 @@ import (
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"github.com/minio/minio-go/v6"
|
|
|
|
|
"net/http"
|
|
|
|
|
"net/url"
|
|
|
|
|
"path"
|
|
|
|
|
"strings"
|
|
|
|
|
"time"
|
|
|
|
@ -52,9 +53,10 @@ func getFileDownLoadUrl(c *gin.Context) {
|
|
|
|
|
originName := resMap["origin_name"]
|
|
|
|
|
storageKey := resMap["storage_key"]
|
|
|
|
|
storageBucket := resMap["storage_bucket"]
|
|
|
|
|
downloadUrl := ConfigUtil.MinioDownloadPrefix + storageBucket + "/" + storageKey
|
|
|
|
|
infix := "?response-content-disposition=attachment%3BfileName%2A%3DUTF-8%27%27"
|
|
|
|
|
downloadUrl := ConfigUtil.MinioDownloadPrefix + storageBucket + "/" + storageKey + infix + url.QueryEscape(url.QueryEscape(originName))
|
|
|
|
|
|
|
|
|
|
c.JSON(http.StatusOK, gin.H{"success": true, "download_url": downloadUrl, "origin_name": originName})
|
|
|
|
|
c.JSON(http.StatusOK, gin.H{"success": true, "download_url": downloadUrl})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -69,6 +71,7 @@ func saveFileInfo(c *gin.Context) {
|
|
|
|
|
c.JSON(http.StatusOK, gin.H{"success": false, "info": "文件id参数不允许为空!"})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
systemId := c.Query("systemid")
|
|
|
|
|
if systemId == "" {
|
|
|
|
|
c.JSON(http.StatusOK, gin.H{"success": false, "info": "系统ID不允许为空!"})
|
|
|
|
|