|
@@ -6,6 +6,7 @@ import (
|
|
"copter-train/log"
|
|
"copter-train/log"
|
|
"errors"
|
|
"errors"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "net/url"
|
|
"strconv"
|
|
"strconv"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
@@ -261,8 +262,9 @@ func ExportTest(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
testExcel.Content = tests
|
|
testExcel.Content = tests
|
|
fmt.Println(len(tests))
|
|
fmt.Println(len(tests))
|
|
testExcel.Draws()
|
|
testExcel.Draws()
|
|
|
|
+ fileName := url.PathEscape(fmt.Sprintf("%s-考核试题.xlsx", db))
|
|
c.Header("Content-Type", "application/octet-stream")
|
|
c.Header("Content-Type", "application/octet-stream")
|
|
- c.Header("Content-Disposition", "attachment; filename="+fmt.Sprintf("%s-考核试题.xlsx", db))
|
|
|
|
|
|
+ c.Header("Content-Disposition", "attachment; filename="+fileName)
|
|
c.Header("Content-Transfer-Encoding", "binary")
|
|
c.Header("Content-Transfer-Encoding", "binary")
|
|
|
|
|
|
err = f.Write(c.Writer)
|
|
err = f.Write(c.Writer)
|