label forbidden status for share list

This commit is contained in:
tickstep 2023-04-30 10:01:32 +08:00
parent ccc285ce5e
commit 0edf7d0af2

View File

@ -316,17 +316,22 @@ func RunShareList() {
et = record.Expiration et = record.Expiration
} }
status := "有效" status := "有效"
if record.FirstFile == nil { if record.Status == "enabled" {
status = "已删除" if record.FirstFile == nil {
} else { status = "已删除"
cz := time.FixedZone("CST", 8*3600) } else {
if len(record.Expiration) > 0 { cz := time.FixedZone("CST", 8*3600)
expiredTime, _ := time.ParseInLocation("2006-01-02 15:04:05", record.Expiration, cz) if len(record.Expiration) > 0 {
if expiredTime.Unix() < now.Unix() { expiredTime, _ := time.ParseInLocation("2006-01-02 15:04:05", record.Expiration, cz)
status = "已过期" if expiredTime.Unix() < now.Unix() {
status = "已过期"
}
} }
} }
} else if record.Status == "forbidden" {
status = "违规"
} }
tb.Append([]string{strconv.Itoa(k + 1), record.ShareId, record.ShareUrl, record.SharePwd, tb.Append([]string{strconv.Itoa(k + 1), record.ShareId, record.ShareUrl, record.SharePwd,
record.ShareName, record.ShareName,
//record.FileIdList[0], //record.FileIdList[0],