登录逻辑调整
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// 小程序更新检测
|
||||
|
||||
import { isLogin } from '@/utils';
|
||||
|
||||
export function mpUpdate() {
|
||||
const updateManager = uni.getUpdateManager();
|
||||
updateManager.onCheckForUpdate((res) => {
|
||||
@@ -50,7 +52,20 @@ export function showToast(title: string, { icon, duration, complete }: ToastOpti
|
||||
});
|
||||
}
|
||||
|
||||
export function goPath(path: string) {
|
||||
export function goPath(path: string, needAuth: boolean = false) {
|
||||
if(needAuth && !isLogin()) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
showCancel: true,
|
||||
success: (res) => {
|
||||
if(res.confirm) {
|
||||
goLogin();
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(path.includes('home/index') || path.includes('mall/index') || path.includes('qrcode/index') || path.includes('mine/index')) {
|
||||
uni.switchTab({
|
||||
url: path
|
||||
|
Reference in New Issue
Block a user