Wechat group "Apache Linkis community Development group " chat records are as
follows:
she says:
@peacewong@WDS How to implement redirection in gateway
Jiuxian layman:
@she said You can check the redirectto configuration in gatewayfilter.
Generally, you can configure applicationyaml
Jiuxian layman:
For example spring:
cloud:
gateway:
routes:
- id: rewrite_v1
uri: ${rewrite.backend.uri:http://example.com}
predicates:
-Path=/v1/customer/**
filters:
-
RewritePath=/v1/customer/(?<segment>.*),/api/$\{segment}
she says:
This is the linkis gateway of spring gateway. Didn’t this part be encapsulated?
she says:
Thanks I have a look at spring
Jiuxian layman:
Directly configure yaml configuration redirect rules in linkis gateway
Jiuxian layman:
Generally enough, if necessary, you can also inject route-related beans into it
and write your own code to implement the rules
Jiuxian layman:
There are a lot of @she said on the Internet I believe you will understand how
to match it after you check it
she says:
um, thank you for taking a look
she says:
@peacewong@WDS The configuration in linkis should be redirected
she says:
@Jiuxian layman does not meet my needs. This is my unified login to
linkis. I judge whether the user information is stored locally. If so, redirect
to the linkis homepage. This is only redirected according to the status code
route.
peacewong@WDS:
Yes, @she said You can read the article written by Brother Long Ping
@CCweixiao_iqiyi_leojie
peacewong@WDS:
https://mp.weixin.qq.com/s/Qx-24QGbTYg3pdcWwsuvKg
she says:
OK!
-----------------
微信群“Apache Linkis社区开发群”聊天记录
如下面所述:
她说:
@peacewong@WDS 大佬gateway里面重定向怎么实现啊
酒弦居士:
@她說 可以查一下gatewayfilter 里面的redirectto配置 一般配置一下applicantionyaml即可
酒弦居士:
比如spring:
cloud:
gateway:
routes:
- id: rewrite_v1
uri: ${rewrite.backend.uri:http://example.com}
predicates:
- Path=/v1/customer/**
filters:
-
RewritePath=/v1/customer/(?<segment>.*),/api/$\{segment}
她说:
这个是spring gateway的 linkis gateway 没有封装这部分吗
她说:
感谢 我看看 spring的
酒弦居士:
linkis gateway里面直接配置yaml配置redirect规则即可
酒弦居士:
一般够用 真是需要也可以把route相关bean注入进来自己写代码实现规则
酒弦居士:
这个网上很多的 @她說 相信您一查就明白咋配了
她说:
嗯呢 感谢我去看下
她说:
@peacewong@WDS 大佬linkis里面这样配置应该会重定向吧
她说:
@酒弦居士 有点不符合 我这需求。我这是统一登陆 到linkis中。我这判断本地是否存储用户信息 有就重定向到 linkis主页 这个只是根据状态码
路由去重定向的吧
peacewong@WDS:
是的,@她說 可以看看龙平兄之前写的文章来着@CCweixiao_iqiyi_leojie
peacewong@WDS:
https://mp.weixin.qq.com/s/Qx-24QGbTYg3pdcWwsuvKg
她说:
好的!