|
@@ -944,12 +944,12 @@ func (this *ResourceAuthController) FileDownload() {
|
|
|
br.Ret = 408
|
|
|
return
|
|
|
}
|
|
|
- fileName := this.GetString("FileName")
|
|
|
- fileName = strings.TrimSpace(fileName)
|
|
|
- if fileName == "" {
|
|
|
- br.Msg = "参数有误"
|
|
|
- return
|
|
|
- }
|
|
|
+ //fileName := this.GetString("FileName")
|
|
|
+ //fileName = strings.TrimSpace(fileName)
|
|
|
+ //if fileName == "" {
|
|
|
+ // br.Msg = "参数有误"
|
|
|
+ // return
|
|
|
+ //}
|
|
|
fileEncode := this.GetString("FileUrl")
|
|
|
fileEncode = strings.TrimSpace(fileEncode)
|
|
|
if fileEncode == "" {
|
|
@@ -963,6 +963,13 @@ func (this *ResourceAuthController) FileDownload() {
|
|
|
return
|
|
|
}
|
|
|
fileUrl := string(fileByte)
|
|
|
+ fileArr := strings.Split(fileUrl, "/")
|
|
|
+ if len(fileArr) == 0 {
|
|
|
+ br.Msg = "文件地址有误"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fileName := fileArr[len(fileArr)-1]
|
|
|
+ //fmt.Println(fileName)
|
|
|
|
|
|
// 获取文件
|
|
|
down, e := http.Get(fileUrl)
|