fix: 修正微信公众号路由(传送门来源以及CareerEngine来源)中的图片链接 (#4590)

This commit is contained in:
lightyears
2020-04-28 23:42:08 +08:00
committed by GitHub
parent 853f00ee25
commit 4a3ac0ce45
2 changed files with 15 additions and 2 deletions

View File

@@ -30,7 +30,12 @@ module.exports = async (ctx) => {
article('#js_content img').each((index, elem) => {
const $elem = article(elem);
$elem.attr('referrerpolicy', 'no-referrer');
const imgSrc = $elem.attr('data-original');
if (imgSrc) {
const realSrc = imgSrc.replace(/^https:\/\/img.chuansongme.com\//, 'https://mmbiz.qpic.cn/');
$elem.attr('src', realSrc);
}
});
const single = {