微信小程序获取当前路径

const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const url = `/${currentPage.route}`;
原文地址:https://www.cnblogs.com/xiaozhou223/p/12742992.html