token是写死的吗_关于拦截器是用注解方便,还是用配置文件写死方便的总结。...

@Configurationpublic class TaobaoWebMvcConfigurer extendsCommonWebMvcConfigurer {

@Autowired

VerifyRsaTokenInterceptor verifyRsaTokenInterceptor;

@Autowired

VerifyShopIdInterceptor verifyShopIdInterceptor;

@Autowired

VerifyAesTokenInterceptor verifyAesTokenInterceptor;/*** 将拦截器注册到此项目中.*/@Overridepublic voidaddInterceptors(InterceptorRegistry registry) {/*1.验证token*/registry.addInterceptor(verifyRsaTokenInterceptor).addPathPatterns("/**")

.excludePathPatterns("/buildToken")

.excludePathPatterns("/importShopId")

.excludePathPatterns("/TaobaoShopStatusGet")

.excludePathPatterns("/slb.html")/*1.TaobaoJushitaJdpUsersGet 需要这个来统计活跃度。这个接口需要的安全度不高,delphi和guanli模块都有调用,完全开放。

2.TaobaoJushitaJdpUserDelete 需要用这个来定时关闭 数据推送,不可拦截。用下面的Aes128拦截器拦截。*/.excludePathPatterns("/TaobaoJushitaJdpUsersGet")

.excludePathPatterns("/TaobaoJushitaJdpUserDelete")/*御城河日志的,这个比较特殊,因为登录前,登录失败的需要对接日志,而此时并没有http协议头的token。所以这个接口放行。*/.excludePathPatterns("/YchLogLogin")

.order(1);/*2.验证shopId*/registry.addInterceptor(verifyShopIdInterceptor).addPathPatterns("/**")

.excludePathPatterns("/buildToken")

.excludePathPatterns("/importShopId")

.excludePathPatterns("/TaobaoShopStatusGet")

.excludePathPatterns("/slb.html")/*1.TaobaoJushitaJdpUsersGet 需要这个来统计活跃度。这个接口需要的安全度不高,delphi和guanli模块都有调用,完全开放。

2.TaobaoJushitaJdpUserDelete 需要用这个来定时关闭 数据推送,不可拦截。用下面的Aes128拦截器拦截。*/.excludePathPatterns("/TaobaoJushitaJdpUsersGet")

.excludePathPatterns("/TaobaoJushitaJdpUserDelete")/*御城河日志相关的5个接口,不做shopId校验,让这5个接口通过。*/.excludePathPatterns("/YchLogTop")

.excludePathPatterns("/YchLogSql")

.excludePathPatterns("/YchLogLogin")

.excludePathPatterns("/YchLogOrder")

.excludePathPatterns("/YchLogSendOrder")

.order(2);/*3.有一些接口,无法验证颁发的token,为了安全,避免接口完全开放,

这类接口利用对称秘钥,验证固定字符串,只增加需要拦截的。多数不需要这个拦截器拦截。

TaobaoJushitaJdpUserDelete -- 场景为,需要 guanli 模块定时调用,其它模块基本用不到。*/registry.addInterceptor(verifyAesTokenInterceptor).addPathPatterns("/TaobaoJushitaJdpUserDelete").order(3);

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值