|
|
import $ from 'yoho-jquery';
|
|
|
|
|
|
function XianyuLinkHandle() {
|
|
|
const cookie = require('yoho-cookie');
|
|
|
|
|
|
cookie.set('aaa', '123');
|
|
|
|
|
|
$(document).delegate('a:not(.yoho-coin, .yoho-conpon, .web-share-button, .button-ok)',
|
|
|
'click',
|
|
|
event => {
|
|
|
let currentTarget = $(event.currentTarget);
|
|
|
|
|
|
let href = currentTarget.attr('href').replace('https', 'http');
|
|
|
|
|
|
let tag = href.indexOf('?') >= 0 ? '&' : '?';
|
|
|
|
|
|
href = href + tag + 'isNeedRefresh=false';
|
|
|
|
|
|
if (href.indexOf('#') !== 0) {
|
|
|
let args = {url: href};
|
|
|
|
|
|
if (window.WindVane) {
|
|
|
window.WindVane.call('Base', 'openWindow', args, () => {
|
|
|
console.log('open new window success');
|
|
|
}, () => {
|
|
|
window.open(args.url, '_blank');
|
|
|
});
|
|
|
} else {
|
|
|
window.open(args.url, '_blank');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
event.preventDefault();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
export default new XianyuLinkHandle(); |
...
|
...
|
|