已确保idea工具默认设置都是UTF-8格式:
 
 
然后在配置类上,指定编码:
@PropertySource(value = "classpath:short_message.properties",encoding = "UTF-8")
 
 
@Data
@Component
@PropertySource(value = "classpath:short_message.properties",encoding = "UTF-8")
@ConfigurationProperties()
public class ShortMessageConfig {
    /**
     * 阿里云访问控制台寻找 KeyId
     */
    private String accessKeyId;
 
    /**
     * 阿里云访问控制台寻找 KeySecret
     */
    private String accessKeySecret;
 
    /**
     * 产品名称
     */
    private String product;
 
    /**
     * 产品域名
     */
    private String domain;
 
    /**
     * 地域
     */
    private String region;
 
    /**
     * 签名名称
     */
    private String signName;
 
    /**
     * 模版CODE
     */
    private String templateCode;
}
 posted on 2018-10-25 14:24  ding-xu  阅读(777)  评论(0编辑  收藏  举报