feat(mp): 新增 navigate 工具函数
This commit is contained in:
12
apps/miniprogram/src/utils/navigate.ts
Normal file
12
apps/miniprogram/src/utils/navigate.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
const LOGIN_PAGE = '/pages/login/index';
|
||||||
|
|
||||||
|
export function navigateToLogin() {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: LOGIN_PAGE,
|
||||||
|
fail: () => {
|
||||||
|
Taro.reLaunch({ url: LOGIN_PAGE });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user