请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Error: connect ECONNREFUSED 127.0.0.1:8081

接口调用提示:Error: connect ECONNREFUSED 127.0.0.1:8081
接口地址:http://127.0.0.1:8081/commodity/list
请求方式:POST
请求参数:
{
“ids”: [
“1000001”,
“1000002”
]
}

正在回答 回答被采纳积分+3

1回答

提问者 宇文树学1994 2023-03-29 10:08:14

注释掉application.yml里面的amqps配置:

#aliyun:
#  accessKey: xxx
#  accessSecret: xxx
#  iot:
#    endpoint: iot.cn-shanghai.aliyuncs.com
#    consumerGroup: xxx
#    amqp:
#      host: 1984706750605697.iot-amqp.cn-shanghai.aliyuncs.com

然后将AmqpClient类整个注释掉,再注释掉IoTDeviceServiceImpl类里面的:

//  @Value("${aliyun.accessKey}")
//  private String accessKey;
//
//  @Value("${aliyun.accessSecret}")
//  private String accessSecret;
//
//  @Value("${aliyun.iot.endpoint}")
//  private String endpoint;

//  @PostConstruct
//  public void init() throws Exception {
//    Config config = new Config()
//        .setAccessKeyId(accessKey)
//        .setAccessKeySecret(accessSecret);
//    config.endpoint = endpoint;
//    client = new com.aliyun.iot20180120.Client(config);
//  }

这样就好了。

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号