update:宜安内嵌页面

This commit is contained in:
2025-12-10 16:50:36 +08:00
parent f6ce1ace1e
commit e827838102
7 changed files with 99 additions and 7 deletions

View File

@@ -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) => {

View File

@@ -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>

View File

@@ -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,
],
});

View File

View 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>

View 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;

View 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>