interceptor.md 1.2 KB
Newer Older
D
DCloud_LXH 已提交
1 2 3 4
## uni.addInterceptor(name, interceptor) @addinterceptor

<!-- UTSAPIJSON.addInterceptor.description -->

D
DCloud_LXH 已提交
5 6
<!-- UTSAPIJSON.addInterceptor.compatibility -->

D
DCloud_LXH 已提交
7 8 9 10 11 12 13 14 15 16
<!-- UTSAPIJSON.addInterceptor.param -->

<!-- UTSAPIJSON.addInterceptor.returnValue -->

<!-- UTSAPIJSON.addInterceptor.tutorial -->

## uni.removeInterceptor(name, interceptor?) @removeinterceptor

<!-- UTSAPIJSON.removeInterceptor.description -->

D
DCloud_LXH 已提交
17 18
<!-- UTSAPIJSON.removeInterceptor.compatibility -->

D
DCloud_LXH 已提交
19 20 21 22 23 24 25 26 27 28 29 30
<!-- UTSAPIJSON.removeInterceptor.param -->

<!-- UTSAPIJSON.removeInterceptor.returnValue -->

<!-- UTSAPIJSON.removeInterceptor.tutorial -->

<!-- UTSAPIJSON.interceptor.example -->

<!-- UTSAPIJSON.general_type.name -->

<!-- UTSAPIJSON.general_type.param -->

D
DCloud_LXH 已提交
31
## Tips@tips
D
DCloud_LXH 已提交
32

D
DCloud_LXH 已提交
33
* 目前仅以下接口支持拦截器:navigateTo、redirectTo、reLaunch、switchTab、navigateBack、loadFontFace、pageScrollTo、startPullDownRefresh、setNavigationBarColor、setNavigationBarTitle、setTabBarBadge、removeTabBarBadge、setTabBarItem、setTabBarStyle、hideTabBar、showTabBar、showTabBarRedDot、hideTabBarRedDot
D
DCloud_LXH 已提交
34
* 如需拦截request,可在插件市场搜索[拦截器插件](https://ext.dcloud.net.cn/search?q=%E6%8B%A6%E6%88%AA%E5%99%A8&uni-appx=1)