修改导出文件乱码-去掉中文
This commit is contained in:
parent
8e1241846e
commit
ad84ceb793
@ -160,7 +160,7 @@ func ExportRegister(c *gin.Context) {
|
|||||||
resp.Data = []*exhibition.ExportInfo{}
|
resp.Data = []*exhibition.ExportInfo{}
|
||||||
}
|
}
|
||||||
columns := []string{"画家姓名", "性别", "手机号", "身份证号", "通讯地址", "身份证照片", "本人近照", "作品名称", "报名时间", "更新时间"}
|
columns := []string{"画家姓名", "性别", "手机号", "身份证号", "通讯地址", "身份证照片", "本人近照", "作品名称", "报名时间", "更新时间"}
|
||||||
exportFileName := fmt.Sprintf("%s迁想妙得.xlsx", time.Now().Format("20060102"))
|
exportFileName := fmt.Sprintf("%d.xlsx", time.Now().UnixMilli())
|
||||||
filePath := fmt.Sprintf("./runtime/%s", exportFileName)
|
filePath := fmt.Sprintf("./runtime/%s", exportFileName)
|
||||||
data := make([]interface{}, 0)
|
data := make([]interface{}, 0)
|
||||||
for _, v := range resp.Data {
|
for _, v := range resp.Data {
|
||||||
@ -186,6 +186,7 @@ func ExportRegister(c *gin.Context) {
|
|||||||
_, err = utils.ToExcelByType(columns, data, "slice", filePath)
|
_, err = utils.ToExcelByType(columns, data, "slice", filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
//处理图片
|
//处理图片
|
||||||
// err = logic.DealExcelImg(filePath)
|
// err = logic.DealExcelImg(filePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user