update:宜安内嵌页面
This commit is contained in:
@@ -16,10 +16,11 @@ const service = axios.create({
|
||||
service.interceptors.request.use(
|
||||
(config) => {
|
||||
config.headers['company'] = 'carsafe';
|
||||
config.headers['jobNumber'] = $wujie?.props?.USER_ID || '';
|
||||
config.headers['token'] = $wujie?.props?.TOKEN || '';
|
||||
config.headers['userId'] = $wujie?.props?.USER_ID || '';
|
||||
config.headers['tenantId'] = $wujie?.props?.TENANT_ID || '';
|
||||
config.headers['jobNumber'] = $wujie?.props?.USER_ID || localStorage.getItem('USER_ID') || '';
|
||||
config.headers['token'] = $wujie?.props?.TOKEN || localStorage.getItem('TOKEN') || '';
|
||||
config.headers['userId'] = $wujie?.props?.USER_ID || localStorage.getItem('USER_ID') || '';
|
||||
config.headers['tenantId'] =
|
||||
$wujie?.props?.TENANT_ID || localStorage.getItem('TENANT_ID') || '';
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
|
||||
@@ -29,11 +29,10 @@ import { getAllDictDataFun } from '@/utils/common';
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
onMounted(async() => {
|
||||
onMounted(async () => {
|
||||
await getAllDictDataFun();
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -4,6 +4,7 @@ import EmptyLayout from '@/layouts/empty.vue';
|
||||
import DefaultLayout from '@/layouts/default.vue';
|
||||
import CidLayout from '@/layouts/cid.vue';
|
||||
import routerData from '@/router/routerData';
|
||||
import yianRouter from '@/tenants/yian/router';
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -22,7 +23,7 @@ const router = createRouter({
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: window?. __POWERED_BY_WUJIE__ ? CidLayout : DefaultLayout,
|
||||
component: window?.__POWERED_BY_WUJIE__ ? CidLayout : DefaultLayout,
|
||||
children: routerData,
|
||||
},
|
||||
{
|
||||
@@ -36,6 +37,7 @@ const router = createRouter({
|
||||
},
|
||||
],
|
||||
},
|
||||
...yianRouter,
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
0
src/tenants/lyric/test.ts
Normal file
0
src/tenants/lyric/test.ts
Normal file
29
src/tenants/yian/layout.vue
Normal file
29
src/tenants/yian/layout.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div class="layout-content">
|
||||
<RouterView v-if="!loading" />
|
||||
<div v-else class="loading" v-loading="loading" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { getAllDictDataFun } from '@/utils/common';
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
await getAllDictDataFun();
|
||||
loading.value = false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.layout-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.loading {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
30
src/tenants/yian/router.ts
Normal file
30
src/tenants/yian/router.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import Layout from '@/tenants/yian/layout.vue';
|
||||
|
||||
const router = [
|
||||
{
|
||||
// 宜安登录
|
||||
path: '/yian/login',
|
||||
name: 'YianLogin',
|
||||
component: () => import('@/tenants/yian/views/login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/yian',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
// 宜安数据总览
|
||||
path: '/yian/data/overview',
|
||||
name: 'YianDataOverview',
|
||||
component: () => import('@/views/data/overview/index.vue'),
|
||||
},
|
||||
{
|
||||
// 宜安数据查询
|
||||
path: '/yian/data/analysis',
|
||||
name: 'YianDataAnalysis',
|
||||
component: () => import('@/views/data/analysis/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default router;
|
||||
31
src/tenants/yian/views/login.vue
Normal file
31
src/tenants/yian/views/login.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onBeforeMount } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
// 跳转白名单
|
||||
const whitePageList = ['/yian/data/overview', '/yian/data/analysis'];
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
onBeforeMount(() => {
|
||||
goPageFun();
|
||||
});
|
||||
|
||||
const goPageFun = () => {
|
||||
const { redirectUrl = '' as any } = route.query;
|
||||
if (redirectUrl && whitePageList.includes(redirectUrl)) {
|
||||
// TODO
|
||||
localStorage.setItem('TOKEN', '');
|
||||
localStorage.setItem('USER_ID', '1980235559149838337');
|
||||
localStorage.setItem('TENANT_ID', '1979091834410176514');
|
||||
const path: any = redirectUrl;
|
||||
router.push({
|
||||
path,
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user