fix: 获取低码服务url
This commit is contained in:
parent
96a2499b92
commit
51794071a7
|
@ -36,4 +36,6 @@ export const systemVersion = () => server.get<{edition?: string}>('/system/versi
|
||||||
*/
|
*/
|
||||||
export const queryDashboard = (data: Record<string, any>) => server.post(`/dashboard/_multi`, data)
|
export const queryDashboard = (data: Record<string, any>) => server.post(`/dashboard/_multi`, data)
|
||||||
|
|
||||||
export const fileUpload = (data: any) => server.post('/file/static', data)
|
export const fileUpload = (data: any) => server.post('/file/static', data)
|
||||||
|
|
||||||
|
export const lowCodeUrl = () => server.get('/system/config/low-code')
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<page-container>
|
<page-container>
|
||||||
<iframe
|
<iframe
|
||||||
|
v-if="loading"
|
||||||
:src="iframeUrl"
|
:src="iframeUrl"
|
||||||
frameBorder="0"
|
frameBorder="0"
|
||||||
style="width: 100%; height: calc(100vh - 140px)"
|
style="width: 100%; height: calc(100vh - 140px)"
|
||||||
|
@ -12,10 +13,11 @@
|
||||||
import { TOKEN_KEY } from '@/utils/variable';
|
import { TOKEN_KEY } from '@/utils/variable';
|
||||||
import { LocalStore, getToken } from '@/utils/comm';
|
import { LocalStore, getToken } from '@/utils/comm';
|
||||||
import { getAppInfo_api } from '@/api/system/apply';
|
import { getAppInfo_api } from '@/api/system/apply';
|
||||||
|
import { lowCodeUrl } from '@/api/comm'
|
||||||
|
|
||||||
const iframeUrl = ref<string>('');
|
const iframeUrl = ref<string>('');
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const loading = ref(false)
|
||||||
const handle = async (appId: string, url: string) => {
|
const handle = async (appId: string, url: string) => {
|
||||||
const res = await getAppInfo_api(appId);
|
const res = await getAppInfo_api(appId);
|
||||||
let menuUrl: any = url;
|
let menuUrl: any = url;
|
||||||
|
@ -38,16 +40,23 @@ const handle = async (appId: string, url: string) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const lowCode = () => {
|
||||||
|
lowCodeUrl().then(res => {
|
||||||
|
if (res.success && res.result) {
|
||||||
|
const url = res.result['ui-addr']
|
||||||
|
iframeUrl.value = url + '/#' + route.path + '?&token=' + getToken()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
const matchedItem: any = route.matched?.[0]
|
const matchedItem: any = route.matched?.[0]
|
||||||
if (matchedItem?.meta?.isApp) {
|
if (matchedItem?.meta?.isApp) {
|
||||||
const params = route.path.split('/')?.[1];
|
const params = route.path.split('/')?.[1];
|
||||||
console.log(route.path)
|
|
||||||
if (params === 'preview') {
|
if (params === 'preview') {
|
||||||
console.log(route.path)
|
lowCode()
|
||||||
iframeUrl.value = 'http://192.168.33.46:9900' + '/#' + route.path + '?&token=' + getToken()
|
|
||||||
} else {
|
} else {
|
||||||
|
loading.value = true
|
||||||
const url = route.path.split('/').slice(2).join('/');
|
const url = route.path.split('/').slice(2).join('/');
|
||||||
handle(params, url);
|
handle(params, url);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue