|
@@ -1,15 +1,14 @@
|
|
|
-
|
|
|
|
|
import router from './index'
|
|
import router from './index'
|
|
|
import { setBaseUrl } from '@/service/request'
|
|
import { setBaseUrl } from '@/service/request'
|
|
|
|
|
+import { usePort } from '@/hooks/index'
|
|
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
router.beforeEach((to, from, next) => {
|
|
|
- console.log('触发了路由守卫')
|
|
|
|
|
console.log(to.meta.title)
|
|
console.log(to.meta.title)
|
|
|
if (to.meta.title === '物联网') {
|
|
if (to.meta.title === '物联网') {
|
|
|
- console.log('233')
|
|
|
|
|
setBaseUrl('/api')
|
|
setBaseUrl('/api')
|
|
|
} else {
|
|
} else {
|
|
|
setBaseUrl('/rts-api')
|
|
setBaseUrl('/rts-api')
|
|
|
}
|
|
}
|
|
|
|
|
+ usePort(to.meta.title as string)
|
|
|
next()
|
|
next()
|
|
|
})
|
|
})
|