Commit 882856f6 by Li Feifei

修复中文文件名无法被解析

parent 5ff88ecc
......@@ -2,6 +2,7 @@ package main
import (
_ "ppt_server/router"
_ "ppt_server/boot"
"github.com/gogf/gf/frame/g"
)
......
......@@ -23,6 +23,7 @@ type parser struct {
func parseURL(ossFileLink, name string) (*parser, error) {
parseURLPath, err := gurl.ParseURL(ossFileLink, 32)
if err != nil {
......@@ -46,7 +47,9 @@ func parseURL(ossFileLink, name string) (*parser, error) {
//解析课件的URL
func (f *parser) splitFileInfoLink() string {
return fmt.Sprintf("%s?info=0&ssl=1&furl=%s%s", ParserFileLink, g.Cfg().GetString("oss.url"), f.path)
return fmt.Sprintf("%s?info=0&ssl=1&furl=%s/%s",
ParserFileLink, g.Cfg().GetString("oss.url"), f.splitUploadPath() + gurl.Encode(f.slicePath[len(f.slicePath)-1:][0]))
}
// 临时存储解析包地址
......
......@@ -81,7 +81,6 @@ func (f *ObtainFile) fileInfo() error {
if err != nil {
return err
}
var fileInfo model.UploadFileInfo
if err = json.Unmarshal(fileBytes, &fileInfo); err != nil {
return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment