There was an error while loading. Please reload this page.
Daming提供了对阿里云短信服务的实现,您可以通过配置将其打开
Daming
# application-{profile}.properties daming.sms.provider=aliyun
使用如下配置注入access key和secret
access key
secret
daming.aliyun.accessKeyId={your key id} daming.aliyun.accessKeySecret={your key secret}
或者直接注入经过定制的IAcsClient实例:
IAcsClient
@Bean(name="acsClient") public IAcsClient acsClient() { IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com"); // other configurations return new DefaultAcsClient(profile); }
最后通过配置注入短信签名和模板代码(在阿里云短信控制台可以找到这些信息)
daming.aliyun.sms.signature={your text} #encode it in unicode daming.aliyun.sms.templateCode={your code}