From f359130e9b9e7cbb45de5783251a19900dec98fa Mon Sep 17 00:00:00 2001 From: wanganxp Date: Thu, 2 Nov 2023 04:09:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=95=8C=E9=9D=A2=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/interceptor/interceptor.uvue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pages/API/interceptor/interceptor.uvue b/pages/API/interceptor/interceptor.uvue index 820fc196..6e20f96c 100644 --- a/pages/API/interceptor/interceptor.uvue +++ b/pages/API/interceptor/interceptor.uvue @@ -1,7 +1,8 @@ @@ -26,21 +27,23 @@ export default { data() { return { - + msg:"会跳转到测试页面1" } }, methods: { addInterceptor() { uni.addInterceptor('navigateTo', interceptor) uni.showToast({ - title: '拦截器已添加' - }) + title: '页面跳转已拦截' + }) + this.msg = ",路由被劫持到测试页面2" }, removeInterceptor() { uni.removeInterceptor('navigateTo', interceptor) uni.showToast({ title: '拦截器已移除' - }) + }) + this.msg = "会跳转到测试页面1" }, navigateTo() { uni.navigateTo({ @@ -59,4 +62,4 @@ \ No newline at end of file + -- GitLab