mirror of https://github.com/bjdgyc/anylink.git
强转int8
This commit is contained in:
parent
a8d0a39ca0
commit
c68374f4f0
|
@ -129,6 +129,7 @@ func UserUpload(w http.ResponseWriter, r *http.Request) {
|
||||||
io.Copy(newFile, file)
|
io.Copy(newFile, file)
|
||||||
if err = UploadUser(newFile.Name()); err != nil {
|
if err = UploadUser(newFile.Name()); err != nil {
|
||||||
RespError(w, RespInternalErr, err)
|
RespError(w, RespInternalErr, err)
|
||||||
|
os.Remove(base.Cfg.FilesPath + header.Filename)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
os.Remove(base.Cfg.FilesPath + header.Filename)
|
os.Remove(base.Cfg.FilesPath + header.Filename)
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
|
|
||||||
"github.com/bjdgyc/anylink/dbdata"
|
"github.com/bjdgyc/anylink/dbdata"
|
||||||
"github.com/bjdgyc/anylink/pkg/utils"
|
"github.com/bjdgyc/anylink/pkg/utils"
|
||||||
|
"github.com/spf13/cast"
|
||||||
"github.com/xuri/excelize/v2"
|
"github.com/xuri/excelize/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -39,8 +40,7 @@ func UploadUser(file string) error {
|
||||||
limittime, _ := time.Parse("2006-01-02 15:04:05", row[5])
|
limittime, _ := time.Parse("2006-01-02 15:04:05", row[5])
|
||||||
disableOtp, _ := strconv.ParseBool(row[7])
|
disableOtp, _ := strconv.ParseBool(row[7])
|
||||||
group := []string{row[8]}
|
group := []string{row[8]}
|
||||||
s, _ := strconv.Atoi(row[9])
|
status := cast.ToInt8(row[9])
|
||||||
status := int8(s)
|
|
||||||
sendmail, _ := strconv.ParseBool(row[10])
|
sendmail, _ := strconv.ParseBool(row[10])
|
||||||
// createdAt, _ := time.Parse("2006-01-02 03:04:05", row[11])
|
// createdAt, _ := time.Parse("2006-01-02 03:04:05", row[11])
|
||||||
// updatedAt, _ := time.Parse("2006-01-02 03:04:05", row[12])
|
// updatedAt, _ := time.Parse("2006-01-02 03:04:05", row[12])
|
||||||
|
|
Loading…
Reference in New Issue