You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
<template>
|
|
<div class="mobile-page">
|
|
<iframe v-if="h5Src" class="iframe-page" :src="h5Src" title="Mobile Page"></iframe>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import { getToken } from "@/utils/auth";
|
|
export default {
|
|
data() {
|
|
return {
|
|
h5Src: '',
|
|
};
|
|
},
|
|
created() {
|
|
const isProDuction = process.env.NODE_ENV === "production";
|
|
const topTab = sessionStorage.getItem("topTab");
|
|
console.log(topTab)
|
|
// 本地h5地址
|
|
const devSrc = topTab === 'sluice'
|
|
? "http://172.16.35.166:8002/mobileH5/SZengineeringInspectionList"
|
|
: 'http://172.16.35.166:8002/mobileH5/engineeringInspectionList';
|
|
// prod地址
|
|
// const proSrc = 'http://shuili-h5.product.dev.com:30115/'
|
|
// 获取当前请求地址
|
|
const currentUrl = topTab === 'sluice'
|
|
? window.location.origin + "/mobileH5/SZengineeringInspectionList"
|
|
: window.location.origin + '/mobileH5/engineeringInspectionList';
|
|
console.log("currentUrl:", currentUrl);
|
|
this.h5Src = `${isProDuction ? currentUrl : devSrc}?t=${getToken()}`;
|
|
console.log(123123)
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="scss">
|
|
.mobile-page {
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
.iframe-page {
|
|
border: 1px solid #ccc;
|
|
border-radius: 10px;
|
|
width: 375px;
|
|
height: 720px;
|
|
}
|
|
}
|
|
</style>
|
|
|