import router from './index'
import { setBaseUrl } from '@/service/request'
import { usePort } from '@/hooks/index'

router.beforeEach((to, from, next) => {
  console.log(to.meta.title)
  if (to.meta.title === '物联网') {
    setBaseUrl('/api')
  } else {
    setBaseUrl('/rts-api')
  }
  usePort(to.meta.title as string)
  next()
})
