import store from '@/store';
const navigateTo = (params) => {
	let token = uni.getStorageSync("token");
	//别的操作
	if (token) {
		//可以再做一次token校检
		store.commit('upDateUserInfoMount')
	}
	uni.navigateTo(params)
}

const redirectTo = (params) => {
	let token = uni.getStorageSync("token");
	//别的操作
	if (token) {
		//可以再做一次token校检
		store.commit('upDateUserInfoMount')
	}
	uni.redirectTo(params)
}

const reLaunch = (params) => {
	let token = uni.getStorageSync("token");
	//别的操作
	if (token) {
		//可以再做一次token校检
		store.commit('upDateUserInfoMount')
	}
	uni.reLaunch(params)
}


const switchTab = (params) => {
	let token = uni.getStorageSync("token");
	//别的操作
	if (token) {
		//可以再做一次token校检
		store.commit('upDateUserInfoMount')
	}
	uni.switchTab(params)
}

const navigateBack = (params) => {
	let token = uni.getStorageSync("token");
	//别的操作
	if (token) {
		//可以再做一次token校检
		store.commit('upDateUserInfoMount')
	}
	uni.navigateBack(params)
}


const preloadPage = (params) => {
	let token = uni.getStorageSync("token");
	//别的操作
	if (token) {
		//可以再做一次token校检
		store.commit('upDateUserInfoMount')
	}
	uni.preloadPage(params)
}

module.exports = {
	navigateTo,
	redirectTo,
	reLaunch,
	switchTab,
	navigateBack,
	preloadPage
}
