Commit ac123335 by 张立顺

Merge branch 'develop' of http://192.168.3.233:8090/dj-simple/dj-admin into develop

2 parents 15a67556 553cd0cc
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
916: {
path: "/accountCenter",
name: "accountCenter",
meta: {
title: "账户中心",
authId: "916",
parentId: "1",
cache: false
}
},
91601: {
path: "/account",
name: "account",
meta: {
title: "账户类型列表",
authId: "91601",
parentId: "916",
cache: false
},
component: _import("accountCenter/account")
},
91602: {
path: "/product",
name: "product",
meta: {
title: "产品管理",
authId: "91602",
parentId: "916",
cache: false
},
component: _import("accountCenter/product")
},
91603: {
path: "/menu",
name: "menu",
meta: {
title: "菜单管理",
authId: "91603",
parentId: "916",
cache: false
},
component: _import("accountCenter/menu")
},
91604: {
path: "/function",
name: "function",
meta: {
title: "功能管理",
authId: "91604",
parentId: "916",
cache: false
},
component: _import("accountCenter/function")
},
91605: {
path: "/dictionary",
name: "dictionary",
meta: {
title: "字典管理",
authId: "91605",
parentId: "916",
cache: false
},
component: _import("accountCenter/dictionary")
},
91606: {
path: "/merchant",
name: "merchant",
meta: {
title: "商户管理",
authId: "91606",
parentId: "916",
cache: false
},
component: _import("accountCenter/merchant")
},
91607: {
path: "/role",
name: "role",
meta: {
title: "角色管理",
authId: "91607",
parentId: "916",
cache: false
},
component: _import("accountCenter/role")
},
91608: {
path: "/employee",
name: "employee",
meta: {
title: "员工管理",
authId: "91608",
parentId: "916",
cache: false
},
component: _import("accountCenter/employee")
}
}
<template>
<div>
<iframe
id="myIframe"
class="box"
allowfullscreen
:src="iframeSrc + iframeUrlWithParams"
></iframe>
</div>
</template>
<script>
export default {
data() {
return {
iframeSrc: 'http://192.168.1.68:8085/customer/account',
iframeUrl: '/index.html',
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
};
},
computed: {
iframeUrlWithParams() {
// 检查是否已经有 t 参数
if (this.iframeUrl.includes('?t=')) {
// 如果已经有 t 参数,替换它
return this.iframeUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.t);
} else {
// 如果没有 t 参数,添加它
return this.iframeUrl.includes('?')
? this.iframeUrl + '&t=' + this.t
: this.iframeUrl + '?t=' + this.t;
}
}
},
mounted() {
// 监听来自 iframe 的消息
window.addEventListener('message', (event) => {
console.log('收到 iframe 消息:', event.data);
if (event.data.type === 'location-change') {
console.log('Iframe 地址已改变:', event.data.url);
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url);
}
});
},
methods: {
handleIframeLocationChange(url) {
const iframe = document.getElementById('myIframe');
const internalUrl = url;
let newInternalUrl = internalUrl;
if (internalUrl.includes('?t=')) {
newInternalUrl = internalUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.t);
} else {
newInternalUrl = internalUrl.includes('?')
? internalUrl + '&t=' + this.t
: internalUrl + '?t=' + this.t;
}
console.log('新的内部地址:', newInternalUrl);
this.iframeUrl = newInternalUrl
}
}
};
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<div>
<iframe
id="myIframe"
class="box"
allowfullscreen
:src="iframeSrc + iframeUrlWithParams"
></iframe>
</div>
</template>
<script>
export default {
data() {
return {
iframeSrc: 'http://192.168.1.68:8085/customer/dictionaryManage',
iframeUrl: '/index.html',
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
};
},
computed: {
iframeUrlWithParams() {
// 检查是否已经有 t 参数
if (this.iframeUrl.includes('?t=')) {
// 如果已经有 t 参数,替换它
return this.iframeUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.t);
} else {
// 如果没有 t 参数,添加它
return this.iframeUrl.includes('?')
? this.iframeUrl + '&t=' + this.t
: this.iframeUrl + '?t=' + this.t;
}
}
},
mounted() {
// 监听来自 iframe 的消息
window.addEventListener('message', (event) => {
console.log('收到 iframe 消息:', event.data);
if (event.data.type === 'location-change') {
console.log('Iframe 地址已改变:', event.data.url);
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url);
}
});
},
methods: {
handleIframeLocationChange(url) {
const iframe = document.getElementById('myIframe');
const internalUrl = url;
let newInternalUrl = internalUrl;
if (internalUrl.includes('?t=')) {
newInternalUrl = internalUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.t);
} else {
newInternalUrl = internalUrl.includes('?')
? internalUrl + '&t=' + this.t
: internalUrl + '?t=' + this.t;
}
console.log('新的内部地址:', newInternalUrl);
this.iframeUrl = newInternalUrl
}
}
};
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<iframe
class="box"
allowfullscreen
:src="`http://192.168.1.68:5500/html/employee/index.html?t=${t}`"
></iframe>
</template>
<script>
export default {
data() {
return {
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
}
}
}
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<iframe
class="box"
allowfullscreen
:src="`http://192.168.1.68:8085/productManage/functionList.html?t=${t}`"
></iframe>
</template>
<script>
export default {
data() {
return {
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
}
}
}
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<iframe
class="box"
allowfullscreen
:src="`http://192.168.1.68:8085/productManage/menuList.html?t=${t}`"
></iframe>
</template>
<script>
export default {
data() {
return {
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
}
}
}
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<iframe
class="box"
allowfullscreen
:src="`http://192.168.1.68:5500/html/merchant/index.html?t=${t}`"
></iframe>
</template>
<script>
export default {
data() {
return {
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
}
}
}
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<iframe
class="box"
allowfullscreen
:src="`http://192.168.1.68:8085/productManage/productList.html?t=${t}`"
></iframe>
</template>
<script>
export default {
data() {
return {
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
}
}
}
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<iframe
class="box"
allowfullscreen
:src="`http://192.168.1.68:5500/html/role/index.html?t=${t}`"
></iframe>
</template>
<script>
export default {
data() {
return {
t: 'TGT-46-oHQlAR5rTvCorkzy3qYUscqugM3cUUG2WF7ZQXXGrIIw36QevX-qc36.glsx.com'
}
}
}
</script>
<style lang="scss" scoped>
.box {
position: absolute;
width: 97%;
height: 96%;
border: 0;
margin: 20px;
background-color: #fff;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!