import { onMounted } from "vue";
import { reLaunch } from '@tarojs/taro'
import { useInjector } from "vue-vulcan";
import { useAuthData } from "../../../any-hooks/auth/useAuthData";

export function useAuthCheck() {
  const {authData} = useInjector(useAuthData);
  onMounted( () => {    
    if(!authData.value?.token) {
      reLaunch({url: '/pages/login/index'})
    }
  })
}