修改类名
This commit is contained in:
parent
593630e04d
commit
f092d9ba88
|
|
@ -1,6 +1,6 @@
|
||||||
package com.tuoheng.gateway.filter;
|
package com.tuoheng.gateway.filter;
|
||||||
|
|
||||||
import com.tuoheng.gateway.utils.WvpClient;
|
import com.tuoheng.gateway.utils.WvpTokenClient;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
||||||
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
||||||
|
|
@ -69,7 +69,7 @@ public class WvpAccessTokenFilter extends AbstractGatewayFilterFactory<WvpAccess
|
||||||
synchronized (LOCK) {
|
synchronized (LOCK) {
|
||||||
if (cachedAccessToken == null) {
|
if (cachedAccessToken == null) {
|
||||||
log.info("缓存中没有 access token,正在登录 WVP...");
|
log.info("缓存中没有 access token,正在登录 WVP...");
|
||||||
WvpClient.LoginResponse loginResponse = WvpClient.login("admin", "admin");
|
WvpTokenClient.LoginResponse loginResponse = WvpTokenClient.login("admin", "admin");
|
||||||
if (loginResponse.getCode() == 0 && loginResponse.getData() != null) {
|
if (loginResponse.getCode() == 0 && loginResponse.getData() != null) {
|
||||||
cachedAccessToken = loginResponse.getData().getAccessToken();
|
cachedAccessToken = loginResponse.getData().getAccessToken();
|
||||||
log.info("WVP 登录成功,获取到 access token");
|
log.info("WVP 登录成功,获取到 access token");
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import java.nio.charset.StandardCharsets;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
public class WvpClient {
|
public class WvpTokenClient {
|
||||||
|
|
||||||
private static final String WVP_BASE_URL = "http://114.67.89.4:9090";
|
private static final String WVP_BASE_URL = "http://114.67.89.4:9090";
|
||||||
private static final Gson gson = new Gson();
|
private static final Gson gson = new Gson();
|
||||||
Loading…
Reference in New Issue