9433cfb9创建于 2025年12月31日历史提交
//导航锁
type Lock = {
	isNavigating :boolean;
	isSwitching:boolean;
	isPhoneNavigating:boolean;
	isPhoneSwitching:boolean;
	isWechatNavigating:boolean;
	isWechatSwitching:boolean;
	isLoginSuccessTempPass:boolean;
	
}
	
const lock :Lock =  {
	isNavigating:false,
	isSwitching:false,
	// 手机绑定拦截器锁
	isPhoneNavigating: false,
	isPhoneSwitching: false,
	// 微信绑定拦截器锁
	isWechatNavigating: false,
	isWechatSwitching: false,
	// 登录成功后临时放行标识(仅放行一次原路径跳转)
	isLoginSuccessTempPass: false
}

/**
 * 获取当前页面路径
 * @returns 当前页面的路由路径
 */
const getCurrentPagePath = (): string => {
  const pages = getCurrentPages();
  if (pages.length === 0) return '';
  return pages[pages.length - 1].route || '';
};

//去除路径参数
const getPureUrl = (url: string): string => {
  return url.split('?')[0] || '';
};

export {
	lock,
	getCurrentPagePath,
	getPureUrl
}