AOP ?
现在是写了一个方法,所有接口都调用一遍。
1
xinyewdz Oct 23, 2018
拦截器,过滤器都可以。
|
2
elgae Oct 23, 2018
filter
|
3
lcy630409 Oct 23, 2018
接口通过 ajax 或者 wss 传送,将他们封装一个函数,在里面判断...
|
4
sutra Oct 23, 2018
不知道我题目有没有理解对,用 spring-security (当然其也是通过 filter )?
|
5
gaius Oct 23, 2018
HandlerInterceptorAdapter
|
6
ben1024 Oct 23, 2018
JWT,Header 验证
|
7
wu67 Oct 23, 2018
带 token, 没带 token 的请求全部报错就行了
|
8
tribute Oct 23, 2018 via Android
decorate ?
|
9
asLw0P981N0M0TCC Oct 23, 2018
继承?
|
10
whypool Oct 23, 2018
中间件
|
11
jason19659 Oct 23, 2018
filter interceptor
|
12
KingEngine Oct 23, 2018
spring-security 嘛
|
13
DesmondLiu90 Oct 23, 2018
authFilter 啊,里面写验证 token 的逻辑
|
14
licoycn Oct 23, 2018
过滤器
|
15
licoycn Oct 23, 2018
或者使用 Shiro 或 SpringSecurity 这样的安全框架
|
16
yuanfnadi Oct 23, 2018 via iPhone
拦截器。
|
17
auin Oct 23, 2018
如果是普通 web servlet/jsp 项目,用:filter
如果是 springMVC 项目,用:interceptor 如果是 springMVC 大项目,用:SpringSecurity 另不推荐使用 Shiro |
18
xuanbg Oct 23, 2018
非微服务项目:过滤器实现
微服务项目:网关实现 |
19
leeho Oct 23, 2018
axios 拦截器
|
20
lllllliu Oct 23, 2018
AOP 可以。
面向对象继承一个基础类,然后构造方法自动验证也可以。 路由中间件也可以。 |
21
akira Oct 23, 2018
做一个前置网关处理更合理吧
|
22
Variazioni Oct 23, 2018
还不如用 shiro 之类的安全框架。。配置更方便。。
|
23
teg1c Oct 23, 2018
中间件
|
24
wobuhuicode Oct 23, 2018
JWT 啊
|
26
limuyan44 Oct 23, 2018 via Android
filter。。几分钟写完,没什么复杂要求的话随便写写。。登录完 session 丢个 token
|
28
cnit Oct 23, 2018
|
29
cnit Oct 23, 2018
|
30
JokerZX Oct 23, 2018
同 jwt header 验证
|
31
loveCoding Oct 23, 2018
@tom #27 shiro 也是 filter, 轻量级的自己写其实也不要多少时间
|
32
Doodlister Oct 24, 2018 via Android
@liuxey shiro 咋啦
|
33
auin Oct 24, 2018
|