大屏配置

master
mhsnet 1 year ago
parent 2ba2562635
commit d3573f20b0

@ -1,17 +1,19 @@
<template>
<div>
<doc-alert title="大屏设计器" url="https://doc.iocoder.cn/report/screen/" />
<!-- <doc-alert title="全屏" :url="url" /> -->
<doc-alert title="全屏" :url="url" />
<i-frame :src="url" />
</div>
</template>
<script>
import iFrame from "@/components/iFrame/index";
import { getAccessToken } from "@/utils/auth";
export default {
name: "GoView",
components: { iFrame },
data() {
return {
url: 'http://127.0.0.1:3000',
url: 'http://222.71.165.188:8991/#/chart/preview/10?token=' + getAccessToken(),
};
},
};

@ -6,7 +6,8 @@ VITE_DEV_PORT = '8080'
VITE_DEV_PATH = 'http://127.0.0.1:48080'
# production path
VITE_PRO_PATH = 'https://demo.mtruning.club'
# VITE_PRO_PATH = 'https://demo.mtruning.club'
VITE_PRO_PATH = 'http://222.71.165.188:48080'
# 租户开关
VITE_APP_TENANT_ENABLE=true

@ -1,6 +1,7 @@
import { Router } from 'vue-router';
import { PageEnum, PreviewEnum } from '@/enums/pageEnum'
import { loginCheck } from '@/utils'
import { loginCheck, setLocalStorage, getLocalStorage,clearLocalStorage } from '@/utils'
import { StorageEnum } from '@/enums/storageEnum'
// 路由白名单
const routerAllowList = [
@ -13,14 +14,31 @@ const routerAllowList = [
export function createRouterGuards(router: Router) {
// 前置
router.beforeEach(async (to, from, next) => {
console.log(to);
//clearLocalStorage(StorageEnum.GO_SYSTEM_STORE);
if (to.query.token) {
console.log(to.query.token);
let info = {
tenantInfo: {
tenantId: 1
},
userInfo: {
nickName: "芋道源码",
tokenName: "Authorization",
userId: 1,
userName: "芋道源码",
userToken: to.query.token
}
}
setLocalStorage(StorageEnum.GO_SYSTEM_STORE, info);
const infoMsg = getLocalStorage(StorageEnum.GO_SYSTEM_STORE)
console.log(infoMsg);
}
const Loading = window['$loading'];
Loading && Loading.start();
const isErrorPage = router.getRoutes().findIndex((item) => item.name === to.name);
if (isErrorPage === -1) {
next({ name: PageEnum.ERROR_PAGE_NAME_404 })
}
console.log('hhhhhhhi')
// @ts-ignore
if (!routerAllowList.includes(to.name) && !loginCheck()) {

@ -169,7 +169,11 @@ export const fetchRouteParams = () => {
*/
export const fetchRouteParamsLocation = () => {
try {
if(document.location.hash.indexOf("?")> -1){
return document.location.hash.substring(0, document.location.hash.indexOf("?")).split('/').pop() || ''
}else{
return document.location.hash.split('/').pop() || ''
}
} catch (error) {
window['$message'].warning('查询路由信息失败,请联系管理员!')
return ''

Loading…
Cancel
Save