GithubHelp home page GithubHelp logo

Comments (6)

xiaojinzi123 avatar xiaojinzi123 commented on May 25, 2024

不能预先知道的. 别的路由框架有提供这种 api 都是有问题的.
因为一个路由会经过 N 个未知的拦截器. 所以这个结果根本就是未知的.
就算我提供给你 api 从路由表中查, 这个 api 对我设计者来说, 是不对的. 因为告诉你能跳转, 结果在拦截器中被修改

from component.

xiaojinzi123 avatar xiaojinzi123 commented on May 25, 2024

你有这个需求, 你可以描述下场景. 我帮你看下

from component.

brandlee avatar brandlee commented on May 25, 2024

@xiaojinzi123 需求场景是这样的,服务端全会直接下发一些跳转的scheme list,我需要从中过滤出来可以跳转的scheme,并展示在页面上。

from component.

xiaojinzi123 avatar xiaojinzi123 commented on May 25, 2024

@xiaojinzi123 需求场景是这样的,服务端全会直接下发一些跳转的scheme list,我需要从中过滤出来可以跳转的scheme,并展示在页面上。

说实话你这需求是必须查路由表的. RouterCenter.isMatchUri(uri) 这个方法可以查.
但是还是要提醒你一句, 这个方法不是给用户用的. 你就算查出来可以跳转, 最终的结果也未必跳转的成功.
还是上面说的那个原因:有拦截器

我只是不明白, 下发的 url 怎么还能有不能跳转的, 下发的不都是应该对着写好的路由表的嘛

from component.

brandlee avatar brandlee commented on May 25, 2024

@xiaojinzi123 是这样的,下发的url比如说是v1接口且不打算升级,是一整个列表,随着后面的迭代,会有新的跳转scheme,但是老版本是不支持的,所以这个时候,客户端每个版本就会自己来做过滤。

from component.

xiaojinzi123 avatar xiaojinzi123 commented on May 25, 2024

@xiaojinzi123 是这样的,下发的url比如说是v1接口且不打算升级,是一整个列表,随着后面的迭代,会有新的跳转scheme,但是老版本是不支持的,所以这个时候,客户端每个版本就会自己来做过滤。

那这不是因为服务端自己去做兼容的吗?. 下发的 url 表中具备 minVersion 这种字段, 那不就是接口都会根据版本针对性的出了

在我看来 就是服务端不想干这事吧

from component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.