Commit 33834c28 authored by 崔佳豪's avatar 崔佳豪

fix: 用户信息变更更新水印

parent 7b554e2b
Pipeline #54409 passed with stages
...@@ -306,7 +306,7 @@ const Layout = (props) => { ...@@ -306,7 +306,7 @@ const Layout = (props) => {
useEffect(() => { useEffect(() => {
const needMark = () => const needMark = () =>
(props.global.isHaveMark || window.location.origin.replace(/^(http|https):\/\//, '') === 'panda-water.cn') && // (props.global.isHaveMark || window.location.origin.replace(/^(http|https):\/\//, '') === 'panda-water.cn') &&
document.querySelectorAll('.pandawatermark_mask_div').length <= 0 && document.querySelectorAll('.pandawatermark_mask_div').length <= 0 &&
props.global.userInfo props.global.userInfo
if(needMark()) { if(needMark()) {
...@@ -314,7 +314,15 @@ const Layout = (props) => { ...@@ -314,7 +314,15 @@ const Layout = (props) => {
watermark_txt: `${props.global.userInfo.fullName}${props.global.userInfo.loginName})` watermark_txt: `${props.global.userInfo.fullName}${props.global.userInfo.loginName})`
}); });
} }
}, [props.global, props.global.userInfo]); return () => {
const marks = document.querySelectorAll('.pandawatermark_mask_div')
if(marks && marks.length) {
Array.prototype.forEach.call(marks, function(dom, index) {
document.body.removeChild(dom)
})
}
}
}, [props.global.userInfo]);
const onMenuHeaderClick = event => { const onMenuHeaderClick = event => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment