From 7d05b69aac1cd6b06bd7d57dd5edadf56fbb2b8a Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Tue, 28 May 2024 20:33:55 +0800 Subject: [PATCH] feat: remove useless code --- go.mod | 2 +- go.sum | 4 ++-- object/sms.go | 2 +- web/src/ProviderEditPage.js | 6 +----- web/src/Setting.js | 5 ----- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index ffd4dfdd..c344a508 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/beego/beego v1.12.12 github.com/beevik/etree v1.1.0 github.com/casbin/casbin/v2 v2.77.2 - github.com/casdoor/go-sms-sender v0.23.0 + github.com/casdoor/go-sms-sender v0.24.0 github.com/casdoor/gomail/v2 v2.0.1 github.com/casdoor/notify v0.45.0 github.com/casdoor/oss v1.6.0 diff --git a/go.sum b/go.sum index ebc65800..40a3cb1b 100644 --- a/go.sum +++ b/go.sum @@ -1085,8 +1085,8 @@ github.com/casbin/casbin/v2 v2.77.2 h1:yQinn/w9x8AswiwqwtrXz93VU48R1aYTXdHEx4RI3 github.com/casbin/casbin/v2 v2.77.2/go.mod h1:mzGx0hYW9/ksOSpw3wNjk3NRAroq5VMFYUQ6G43iGPk= github.com/casdoor/go-reddit/v2 v2.1.0 h1:kIbfdJ7AA7H0uTQ8s0q4GGZqSS5V9wVE74RrXyD9XPs= github.com/casdoor/go-reddit/v2 v2.1.0/go.mod h1:eagkvwlZ4Hcsuc/uQsLHYEulz5jN65SVSwV/AIE7zsc= -github.com/casdoor/go-sms-sender v0.23.0 h1:N8+By4JNwyilEcx7cp0QGOepafefM88VwV+o3UEFZio= -github.com/casdoor/go-sms-sender v0.23.0/go.mod h1:bOm4H8/YfJmEHjBatEVQFOnAf0OOn1B0Wi5B7zDhws0= +github.com/casdoor/go-sms-sender v0.24.0 h1:LNLsce3EG/87I3JS6UiajF3LlQmdIiCgebEu0IE4wSM= +github.com/casdoor/go-sms-sender v0.24.0/go.mod h1:bOm4H8/YfJmEHjBatEVQFOnAf0OOn1B0Wi5B7zDhws0= github.com/casdoor/gomail/v2 v2.0.1 h1:J+FG6x80s9e5lBHUn8Sv0Y56mud34KiWih5YdmudR/w= github.com/casdoor/gomail/v2 v2.0.1/go.mod h1:VnGPslEAtpix5FjHisR/WKB1qvZDBaujbikxDe9d+2Q= github.com/casdoor/notify v0.45.0 h1:OlaFvcQFjGOgA4mRx07M8AH1gvb5xNo21mcqrVGlLgk= diff --git a/object/sms.go b/object/sms.go index d0ea980a..ca1dbfe7 100644 --- a/object/sms.go +++ b/object/sms.go @@ -48,7 +48,7 @@ func SendSms(provider *Provider, content string, phoneNumbers ...string) error { if provider.AppId != "" { phoneNumbers = append([]string{provider.AppId}, phoneNumbers...) } - } else if provider.Type == sender.Aliyun || provider.Type == sender.SendCloud { + } else if provider.Type == sender.Aliyun { for i, number := range phoneNumbers { phoneNumbers[i] = strings.TrimPrefix(number, "+86") } diff --git a/web/src/ProviderEditPage.js b/web/src/ProviderEditPage.js index ee192a8b..780d44f0 100644 --- a/web/src/ProviderEditPage.js +++ b/web/src/ProviderEditPage.js @@ -209,8 +209,6 @@ class ProviderEditPage extends React.Component { return Setting.getLabel(i18next.t("provider:Public key"), i18next.t("provider:Public key - Tooltip")); } else if (provider.type === "Msg91 SMS" || provider.type === "Infobip SMS" || provider.type === "OSON SMS") { return Setting.getLabel(i18next.t("provider:Sender Id"), i18next.t("provider:Sender Id - Tooltip")); - } else if (provider.type === "SendCloud SMS") { - return "SMS_USER"; } else { return Setting.getLabel(i18next.t("provider:Client ID"), i18next.t("provider:Client ID - Tooltip")); } @@ -262,8 +260,6 @@ class ProviderEditPage extends React.Component { return Setting.getLabel(i18next.t("provider:Auth Key"), i18next.t("provider:Auth Key - Tooltip")); } else if (provider.type === "Infobip SMS") { return Setting.getLabel(i18next.t("provider:Api Key"), i18next.t("provider:Api Key - Tooltip")); - } else if (provider.type === "SendCloud SMS") { - return "SMS_KEY"; } else { return Setting.getLabel(i18next.t("provider:Client secret"), i18next.t("provider:Client secret - Tooltip")); } @@ -1107,7 +1103,7 @@ class ProviderEditPage extends React.Component { ) : this.state.provider.category === "SMS" ? ( - {["Custom HTTP SMS", "Twilio SMS", "Amazon SNS", "Azure ACS", "Msg91 SMS", "Infobip SMS", "SendCloud SMS"].includes(this.state.provider.type) ? + {["Custom HTTP SMS", "Twilio SMS", "Amazon SNS", "Azure ACS", "Msg91 SMS", "Infobip SMS"].includes(this.state.provider.type) ? null : ( diff --git a/web/src/Setting.js b/web/src/Setting.js index 9852e899..ce597f29 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -139,10 +139,6 @@ export const OtherProviderInfo = { logo: `${StaticBaseUrl}/img/social_twilio.svg`, url: "https://www.twilio.com/messaging", }, - "SendCloud SMS": { - logo: `${StaticBaseUrl}/img/sms_sendcloud.png`, - url: "https://www.sendcloud.net/", - }, "SmsBao SMS": { logo: `${StaticBaseUrl}/img/social_smsbao.png`, url: "https://www.smsbao.com/", @@ -1043,7 +1039,6 @@ export function getProviderTypeOptions(category) { {id: "Huawei Cloud SMS", name: "Huawei Cloud SMS"}, {id: "UCloud SMS", name: "UCloud SMS"}, {id: "Twilio SMS", name: "Twilio SMS"}, - {id: "SendCloud SMS", name: "SendCloud SMS"}, {id: "SmsBao SMS", name: "SmsBao SMS"}, {id: "SUBMAIL SMS", name: "SUBMAIL SMS"}, {id: "Msg91 SMS", name: "Msg91 SMS"},