From d4d2b680baff18f950da5e77463c1f0e26dbd567 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 03 四月 2025 10:10:25 +0800 Subject: [PATCH] 2025-04-03 --- src/views/login/index.jsx | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 0a0adc0..d0bc503 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -667,6 +667,20 @@ if (!['shutter', 'linkage_navigation', 'linkage', 'menu_board', 'menu_board_navigation'].includes(res.menu_type)) { res.menu_type = 'shutter' } + + let loginOtop = '' + let loginOleft = '' + let windowWidth = window.innerWidth + let fix = null + res.login_screen_offset && res.login_screen_offset.forEach(item => { + if (!item.offset_x && !item.offset_y) return + + if (fix === null || Math.abs(windowWidth - item.resolution_width) < fix) { + fix = Math.abs(windowWidth - item.resolution_width) + loginOtop = item.offset_y + item.y_unit + loginOleft = item.offset_x + item.x_unit + } + }) let systemMsg = { favicon: res.titlelogo || '', @@ -684,7 +698,9 @@ navBar: res.menu_type, // shutter 鐧惧彾绐椼�乴inkage_navigation 鑱斿姩鑿滃崟銆乴inkage 鑱斿姩鑿滃崟_鏃犲鑸爮銆乵enu_board 鑿滃崟闈㈡澘銆乵enu_board_navigation 鑿滃崟闈㈡澘_鏍囩椤� app_version: res.app_version, Member_Level: 0, - appname: res.appname || '' + appname: res.appname || '', + loginOtop: loginOtop, + loginOleft: loginOleft } if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { @@ -798,6 +814,9 @@ window.location.reload() return } + + window.GLOB.loginOtop = systemMsg.loginOtop + window.GLOB.loginOleft = systemMsg.loginOleft this.setState({ loginWays: login_ways, @@ -1024,12 +1043,24 @@ render () { const { lineColor, loginlogo, bgImage, copyRight, webSite, ICP, loginWays, platName } = this.state + let wrapStyle = {} + + if (bgImage) { + wrapStyle.backgroundImage = `url(${bgImage})` + } + if (window.GLOB.loginOtop) { + wrapStyle['--mk-login-offset-top'] = window.GLOB.loginOtop + } + if (window.GLOB.loginOleft) { + wrapStyle['--mk-login-offset-left'] = window.GLOB.loginOleft + } + return ( - <div className="login-container" id="mk-login-view"> + <div className="login-container" id="mk-login-view" style={wrapStyle}> <div className="logo" style={lineColor ? {borderColor: lineColor} : {}}> {loginlogo ? <img src={loginlogo} alt=""/> : null} </div> - <div className="login-middle" style={bgImage ? {backgroundImage: 'url(' + bgImage + ')'} : null}> + <div className="login-middle"> {loginWays ? <LoginForm auth={this.state.auth} authError={this.state.authError} @@ -1041,13 +1072,13 @@ authLogin={this.authLogin} wrappedComponentRef={(inst) => this.loginformRef = inst} /> : null} - <div className="login-bottom"> - {webSite && copyRight ? - <a target="_blank" rel="noopener noreferrer" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, ' ') }}></a> : - <p dangerouslySetInnerHTML={{ __html: copyRight ? copyRight.replace(/\s/ig, ' ') : '' }}></p> - } - {ICP ? <a target="_blank" rel="noopener noreferrer" href="https://beian.miit.gov.cn/#/Integrated/index" dangerouslySetInnerHTML={{ __html: ICP.replace(/\s/ig, ' ') }}></a> : null} - </div> + </div> + <div className="login-bottom"> + {webSite && copyRight ? + <a target="_blank" rel="noopener noreferrer" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, ' ') }}></a> : + <p dangerouslySetInnerHTML={{ __html: copyRight ? copyRight.replace(/\s/ig, ' ') : '' }}></p> + } + {ICP ? <a target="_blank" rel="noopener noreferrer" href="https://beian.miit.gov.cn/#/Integrated/index" dangerouslySetInnerHTML={{ __html: ICP.replace(/\s/ig, ' ') }}></a> : null} </div> {/* 缂栬緫鐘舵�佺櫥褰� */} <Modal -- Gitblit v1.8.0