Skip to content
This repository has been archived by the owner. It is now read-only.

Support relative URL, which will resolve real URL by bundle's URL.业务问题 #2795

Open
fromIRIS opened this issue Feb 27, 2017 · 5 comments
Open

Comments

@fromIRIS
Copy link

@fromIRIS fromIRIS commented Feb 27, 2017

sdk0.9.4开始 支持补全代码中的相对地址,用的是bundle的host地址,如何去掉这个功能?

因为我们之前的逻辑是app那边拿到相对地址,再用我们业务需要的host进行补全。这个host与bundle里的host可能是不一样的。

比如我们的js bundle地址是cdn1.xxx.com/js/weex.js,但是业务里的接口的地址却是shop.m.xxx.com/api/getContent

现在的问题就是我们在.we页面里写接口都是相对地址/api/getContent,这样的话weexSDK会根据bundle的host进行转换相对地址,变成了cdn1.xxx.com/api/getContent,导致接口请求404。

目前iOS用的sdk是0.9.5.2,安卓用的是0.10.0

iOS不会自动拼接相对地址,而安卓会自动拼接相对地址

请问有什么方法可以开关这个设置?

@Sonichmj

This comment has been minimized.

Copy link

@Sonichmj Sonichmj commented Feb 27, 2017

@fromIRIS 你这个问题我可以推荐一个可以用的方法,重写UriAdapter的rewrite方法,然后在Application的init方法初始化就可以了。

@fromIRIS

This comment has been minimized.

Copy link
Author

@fromIRIS fromIRIS commented Feb 27, 2017

@AugHua 谢谢 我们尝试一下

@fromIRIS

This comment has been minimized.

Copy link
Author

@fromIRIS fromIRIS commented Mar 3, 2017

@AugHua ios0.10.1版本也是有这样的问题,同样是重写handler就行了吗? 现在ios端重写了网络请求的handler好像有问题

@Sonichmj

This comment has been minimized.

Copy link

@Sonichmj Sonichmj commented Mar 4, 2017

@fromIRIS ios我不太清楚,不过应该是没问题的,还是找weex团队的人问一下吧。

@YorkShen

This comment has been minimized.

Copy link

@YorkShen YorkShen commented Feb 18, 2019

This PR/issue doesn't received response since Weex migrated to Apache two years ago and this repository is no longer active yet.

Feel free to ask question in new repository and thanks for your contribution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.