mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/1Panel-dev/1Panel.git
synced 2026-09-20 08:03:55 +08:00
fix: Fix the issue of initializing SMS sending quantity as a string (#10936)
This commit is contained in:
@@ -317,7 +317,7 @@ type AlertCommonConfig struct {
|
||||
|
||||
type AlertSmsConfig struct {
|
||||
Phone string `json:"phone"`
|
||||
AlertDailyNum uint `json:"alertDailyNum"`
|
||||
AlertDailyNum string `json:"alertDailyNum"`
|
||||
}
|
||||
|
||||
type AlertEmailConfig struct {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -212,7 +213,10 @@ func CheckSMSSendLimit(method string) bool {
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
limitCount := cfg.AlertDailyNum
|
||||
limitCount, err := strconv.ParseUint(cfg.AlertDailyNum, 10, 64)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
checkTaskMutex.Lock()
|
||||
defer checkTaskMutex.Unlock()
|
||||
todayCount, err := alertRepo.GetLicensePushCount(method)
|
||||
@@ -220,7 +224,7 @@ func CheckSMSSendLimit(method string) bool {
|
||||
global.LOG.Errorf("error getting license push count info, err: %v", err)
|
||||
return false
|
||||
}
|
||||
if todayCount >= limitCount {
|
||||
if todayCount >= uint(limitCount) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user