exports.getPath = function (pathWithoutSuffix, params) {
var path = '';
let platform = weex.config.env.platform;
let bundleUrl = weex.config.bundleUrl;
var exp = new RegExp(".+/");
var baseUrl = exp.exec(bundleUrl);
path = baseUrl;
if (platform.toLowerCase() === 'web') {
path += pathWithoutSuffix + '.html'
}
else {
path += pathWithoutSuffix + '.js'
}
if (params) {
path += '?' + params
}
return path;
}
网友评论