Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

同时设置MiniAdpter.nativefiles和URL.basePath后,formatURL的问题 #55

Open
HongMok opened this issue Sep 4, 2018 · 0 comments

Comments

@HongMok
Copy link

HongMok commented Sep 4, 2018

MiniAdpter.nativefiles.push('comp/bg.jpg');  //设置微信小游戏的【本地文件】列表

URL.basePath = "http://www.example.com/";  //设置资源下载的【根路径】

这时formatURL返回的是
http://www.example.com/comp/bg.jpg

但我们希望的是:comp/bg.jpg

所以需要在formatURL中,加入判断:

if(MiniAdpter.nativefiles.indexOf(url)!=-1)
{
	return url;
}

https://github.com/layabox/layaair/blob/76ba77242e775ecf8c3fe03d241578dc86598d54/bin/as/libs/src/laya/net/URL.as#L42-L67

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant