vr-shopxo-source/sourcecode/toutiao/pages/web-view/web-view.js

25 lines
517 B
JavaScript
Raw Normal View History

2018-12-28 10:58:37 +00:00
const app = getApp();
Page({
data: {
web_url: null,
},
onLoad(option) {
2019-06-29 15:32:27 +00:00
// url处理
var url = decodeURIComponent(option.url) || null;
if (url != null)
{
// token处理
if (url.indexOf('{token}') >= 0)
{
var user = app.get_user_cache_info();
var token = (user == false) ? null : user.token || null;
if (token != null)
{
url = url.replace(/{token}/ig, token);
}
}
}
2019-06-29 15:55:47 +00:00
this.setData({web_url: url});
2018-12-28 10:58:37 +00:00
}
});