修复虚拟座舱url问题
This commit is contained in:
parent
3b31338238
commit
1f82c759a5
|
|
@ -1,9 +1,6 @@
|
|||
<script setup>
|
||||
// import { RouterLink, RouterView, useRoute } from 'vue-router'
|
||||
// const { VITE_APP_AUTHORITY, VITE_APP_CLIENT_ID } = import.meta.env
|
||||
|
||||
// const router = useRoute()
|
||||
|
||||
// let t = setInterval(() => {
|
||||
// if (router.query.access_token) {
|
||||
// clearInterval(t)
|
||||
|
|
|
|||
|
|
@ -7,9 +7,15 @@ const router = createRouter({
|
|||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'container',
|
||||
component: () => import('../views/container/index.vue'),
|
||||
},
|
||||
{
|
||||
path: '/plane',
|
||||
name: 'carbin',
|
||||
component: () => import('../views/carbin/index.vue'),
|
||||
},
|
||||
|
||||
// {
|
||||
// path: '/about',
|
||||
// name: 'about',
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ const baseUrl = '/airport/admin'
|
|||
const instance = axios.create({
|
||||
baseURL: baseUrl,
|
||||
timeout: 60 * 1000, //设置超时
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8;',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
||||
'.AspNetCore.Culture': 'c=zh-Hans|uic=zh-Hans',
|
||||
},
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json;charset=UTF-8;',
|
||||
// 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
||||
// '.AspNetCore.Culture': 'c=zh-Hans|uic=zh-Hans',
|
||||
// },
|
||||
})
|
||||
|
||||
let loading
|
||||
|
|
@ -46,9 +46,8 @@ instance.interceptors.request.use(
|
|||
(config) => {
|
||||
// 每次发送请求之前判断是否存在token,如果存在,则统一在http请求的header都加上token,不用每次请求都手动添加了
|
||||
// const { token_type, access_token } = userInfo
|
||||
|
||||
config.headers.Authorization = `${localStorage.getItem('access_token')}`
|
||||
config.headers['Client-Id'] = import.meta.env.VITE_APP_CLIENT_ID
|
||||
// config.headers['Client-Id'] = import.meta.env.VITE_APP_CLIENT_ID
|
||||
//若请求方式为post,则将data参数转为JSON字符串
|
||||
if (config.method === 'POST') {
|
||||
config.data = JSON.stringify(config.data)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<script setup>
|
||||
import { ref, defineAsyncComponent, onMounted, watch, toRaw, defineProps, reactive } from 'vue'
|
||||
import { RouterLink, RouterView, useRoute, useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
console.log(router)
|
||||
|
||||
router.push('/plane')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
Loading…
Reference in New Issue