feat(修复): 远程调用失败404

Signed-off-by: bunny <1319900154@qq.com>
This commit is contained in:
bunny 2024-03-28 17:51:35 +08:00
parent 87cb1a343a
commit dc86482af3
5 changed files with 5 additions and 15 deletions

View File

@ -44,9 +44,6 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
registry.addInterceptor(loginAuthInterceptor).addPathPatterns("/admin/**")
.excludePathPatterns(loginAuthInterceptors);
// String[] userLoginAuthInterceptors = {"/api/user/userInfo/login"};
registry.addInterceptor(userLoginAuthInterceptor).addPathPatterns("/api/**/auth/**");
// registry.addInterceptor(userLoginAuthInterceptor).addPathPatterns("/api/**");
// .excludePathPatterns(userLoginAuthInterceptors);
}
}

View File

@ -46,11 +46,11 @@ spring:
- id: service-cart
uri: lb://service-cart
predicates:
- Path=/api/order/cart/**
- Path=/*/order/cart/**
- id: service-order
uri: lb://service-order
predicates:
- Path=/api/order/orderInfo/**
- Path=/*/order/*/**
data:
redis:
host: ${bunny.redis.host}

View File

@ -3,13 +3,11 @@ package com.atguigu.feign.product;
import com.atguigu.spzx.model.entity.product.ProductSku;
import com.atguigu.spzx.model.vo.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@Component
@FeignClient(value = "service-product")
@FeignClient(name = "service-product")
public interface ProductFeignClient {
@GetMapping("getBySkuId/{skuId}")
Result<ProductSku> getBySkuId(@PathVariable("skuId") Long skuId);
Result<ProductSku> getBySkuId(@PathVariable Long skuId);
}

View File

@ -11,7 +11,7 @@
<packaging>jar</packaging>
<name>service-cart</name>
<url>http://maven.apache.org</url>
<url>https://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -107,11 +107,6 @@ public class UserInfoServiceImpl implements UserInfoService {
*/
@Override
public UserInfoVo getCurrentUserInfo(String token) {
// Object tokenObject = redisTemplate.opsForValue().get(token);
// emptyUtil.isEmpty(tokenObject, MessageConstant.TOKEN_IS_EMPTY);
//
// UserInfo userInfo = JSON.parseObject((String) tokenObject, UserInfo.class);
UserInfo userInfo = BaseContext.getUserInfo();
UserInfoVo userInfoVo = new UserInfoVo();
BeanUtils.copyProperties(userInfo, userInfoVo);