feat: Mock SMS (#1009)

1. Update go-sms-sender to v0.3.0.
2. Fix: avoid page crash if not found provider info.

Signed-off-by: 疯魔慕薇 <kfanjian@gmail.com>

Signed-off-by: 疯魔慕薇 <kfanjian@gmail.com>
This commit is contained in:
疯魔慕薇
2022-08-17 22:02:45 +08:00
committed by GitHub
parent aedef1eea1
commit 91fa024f0b
4 changed files with 19 additions and 5 deletions

View File

@ -49,6 +49,10 @@ export const OtherProviderInfo = {
logo: `${StaticBaseUrl}/img/social_huawei.png`,
url: "https://www.huaweicloud.com/product/msgsms.html",
},
"Mock SMS": {
logo: `${StaticBaseUrl}/img/social_default.png`,
url: "",
},
},
Email: {
"Default": {
@ -539,7 +543,12 @@ export function getProviderLogoURL(provider) {
}
return `${StaticBaseUrl}/img/social_${provider.type.toLowerCase()}.png`;
} else {
return OtherProviderInfo[provider.category][provider.type].logo;
const info = OtherProviderInfo[provider.category][provider.type];
// avoid crash when provider is not found
if (info) {
return info.logo;
}
return "";
}
}