配置变量

在dev配置文件末尾加入参数变量

wechat:
  appid: wx1234564879456
  appsecret: qwer1234564789456124567891453245

使用

在使用的文件中上方引用:

@Value("${wechat.appid}")
private String appId;
@Value("${wechat.appsecret}")
private String appSecret;

然后用的时候就直接使用 appId 和 appSecret 就可以了。

相关文章:

  • 2022-02-05
  • 2022-12-23
  • 2022-02-18
  • 2021-07-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2021-12-23
  • 2021-12-31
  • 2021-12-02
相关资源
相似解决方案