feat(修复): 远程调用失败404
Signed-off-by: bunny <1319900154@qq.com>
This commit is contained in:
parent
87cb1a343a
commit
dc86482af3
|
@ -44,9 +44,6 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
|
||||||
registry.addInterceptor(loginAuthInterceptor).addPathPatterns("/admin/**")
|
registry.addInterceptor(loginAuthInterceptor).addPathPatterns("/admin/**")
|
||||||
.excludePathPatterns(loginAuthInterceptors);
|
.excludePathPatterns(loginAuthInterceptors);
|
||||||
|
|
||||||
// String[] userLoginAuthInterceptors = {"/api/user/userInfo/login"};
|
|
||||||
registry.addInterceptor(userLoginAuthInterceptor).addPathPatterns("/api/**/auth/**");
|
registry.addInterceptor(userLoginAuthInterceptor).addPathPatterns("/api/**/auth/**");
|
||||||
// registry.addInterceptor(userLoginAuthInterceptor).addPathPatterns("/api/**");
|
|
||||||
// .excludePathPatterns(userLoginAuthInterceptors);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -46,11 +46,11 @@ spring:
|
||||||
- id: service-cart
|
- id: service-cart
|
||||||
uri: lb://service-cart
|
uri: lb://service-cart
|
||||||
predicates:
|
predicates:
|
||||||
- Path=/api/order/cart/**
|
- Path=/*/order/cart/**
|
||||||
- id: service-order
|
- id: service-order
|
||||||
uri: lb://service-order
|
uri: lb://service-order
|
||||||
predicates:
|
predicates:
|
||||||
- Path=/api/order/orderInfo/**
|
- Path=/*/order/*/**
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
host: ${bunny.redis.host}
|
host: ${bunny.redis.host}
|
||||||
|
|
|
@ -3,13 +3,11 @@ package com.atguigu.feign.product;
|
||||||
import com.atguigu.spzx.model.entity.product.ProductSku;
|
import com.atguigu.spzx.model.entity.product.ProductSku;
|
||||||
import com.atguigu.spzx.model.vo.result.Result;
|
import com.atguigu.spzx.model.vo.result.Result;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
@Component
|
@FeignClient(name = "service-product")
|
||||||
@FeignClient(value = "service-product")
|
|
||||||
public interface ProductFeignClient {
|
public interface ProductFeignClient {
|
||||||
@GetMapping("getBySkuId/{skuId}")
|
@GetMapping("getBySkuId/{skuId}")
|
||||||
Result<ProductSku> getBySkuId(@PathVariable("skuId") Long skuId);
|
Result<ProductSku> getBySkuId(@PathVariable Long skuId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>service-cart</name>
|
<name>service-cart</name>
|
||||||
<url>http://maven.apache.org</url>
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|
|
@ -107,11 +107,6 @@ public class UserInfoServiceImpl implements UserInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public UserInfoVo getCurrentUserInfo(String token) {
|
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();
|
UserInfo userInfo = BaseContext.getUserInfo();
|
||||||
UserInfoVo userInfoVo = new UserInfoVo();
|
UserInfoVo userInfoVo = new UserInfoVo();
|
||||||
BeanUtils.copyProperties(userInfo, userInfoVo);
|
BeanUtils.copyProperties(userInfo, userInfoVo);
|
||||||
|
|
Loading…
Reference in New Issue