Skip to content

Commit

Permalink
Revert "定制化医疗业务增加屏蔽A区链接跳转功能 (#1334)" (#1336)
Browse files Browse the repository at this point in the history
This reverts commit 2089ecb.
  • Loading branch information
PengXing authored Mar 15, 2019
1 parent 2089ecb commit c0ba06e
Showing 1 changed file with 2 additions and 32 deletions.
34 changes: 2 additions & 32 deletions src/mip-custom/mip-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,41 +171,11 @@ define(function () {
require.config(config);
}


// common 数据缓存
if (data.common) {
commonData = data.common;
}

// 医疗屏蔽A区跳转
if (commonData.product === 'medicine') {
var specialLink = [
// 寻医问药
'mip.imask.xywy.com',
// 宝宝知道
'baobao.baidu.com',
// 柠檬爱美
'lemon.baidu.com',
// 春雨医生
'm.chunyuyisheng.com',
// 好大夫
'mip.haodf.com',
// 百科名医
'm.baikemy.com'
];
specialLink = specialLink.join(',');
// 特殊网站 绕过屏蔽,
if (commonData.originalUrl && commonData.originalUrl.indexOf(specialLink) < 0) {
var alink = document.querySelectorAll('a');

for (var i = 0; i < alink.length; i++) {
if (alink[i].href.indexOf('author.baidu.com') < 0) {
alink[i].href = 'javascript:void(0)';
}
}
}
}

// 模板数据缓存
if (data.template) {
template = data.template;
Expand All @@ -216,6 +186,7 @@ define(function () {
var container = document.createElement('div');
container.setAttribute('mip-custom-container', i);
element.appendChild(container);

// dom 渲染
dom.render(element, tplData, container);
}
Expand All @@ -230,7 +201,6 @@ define(function () {
window.MIP.adShow = true
// 移除广告占位符号
dom.removePlaceholder.apply(this);

};

/**
Expand Down Expand Up @@ -503,4 +473,4 @@ define(function () {
};

return customElement;
});
});

0 comments on commit c0ba06e

Please sign in to comment.