avalon.oniui icon indicating copy to clipboard operation
avalon.oniui copied to clipboard

mmRouter增加了大数限制之后,导致val为undifine

Open supersoup opened this issue 9 years ago • 2 comments

mmRouter/mmRouter.js 第123行

if(!(value.match(/^[0-9]{17,}$/g) || value > "9007199254740992")) val = JSON.parse(value)

如果 value = "abc"; 则 value > "9007199254740992" 为 true, 导致 val 为 undifine, 使得路由功能无效.

supersoup avatar Sep 12 '16 11:09 supersoup

因为已经超过JS的最大浮点数了

RubyLouvre avatar Sep 12 '16 12:09 RubyLouvre

比如我的 url 是 “product/add",

然后:

avalon.router.get("product/:type", function(type) {
    avalon.log(type);  //undifine
})

就无法获取到我的 type 的值。

supersoup avatar Sep 13 '16 03:09 supersoup