pull/9/head
tanghc 4 years ago
parent 1f9b82776d
commit a79eeb0208
  1. 5
      sop-website/sop-website-server/src/main/java/com/gitee/sop/websiteserver/bean/EurekaUri.java
  2. 2
      sop-website/sop-website-server/src/main/java/com/gitee/sop/websiteserver/service/impl/NacosServerService.java

@ -5,6 +5,7 @@ import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.internal.http.HttpMethod;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMethod;
/**
@ -49,13 +50,13 @@ public enum EurekaUri {
}
public Request getRequest(String url, String... args) {
url = StringUtils.trimTrailingCharacter(url, '/');
String requestUrl = url + getUri(args);
Request request = this.getBuilder()
return this.getBuilder()
.url(requestUrl)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
return request;
}
public Request.Builder getBuilder() {

@ -1,6 +1,5 @@
package com.gitee.sop.websiteserver.service.impl;
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.alibaba.nacos.api.PropertyKeyConst;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.naming.NamingFactory;
@ -9,7 +8,6 @@ import com.alibaba.nacos.api.naming.pojo.Instance;
import com.gitee.sop.websiteserver.service.ServerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import javax.annotation.PostConstruct;

Loading…
Cancel
Save