在前端工程的入口页面增加以下代码:
mounted() {
console.log("herf = " + window.location.href);
if (window.location.href == 'https://example.com/') {
window.location.href = 'https://www.example.com/'
}
},
在前端工程的入口页面增加以下代码:
mounted() {
console.log("herf = " + window.location.href);
if (window.location.href == 'https://example.com/') {
window.location.href = 'https://www.example.com/'
}
},
本文标题:前端开发实现网站自动添加www
本文链接:https://www.haomeiwen.com/subject/jamfvdtx.html
网友评论