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 | 70 ++++++++++++++++++++++++++--------- 1 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 37d2515..d0bc503 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -552,10 +552,15 @@ } if (res.query_address !== 'true') { - localStorage.setItem(_addressUrl, 'false') + localStorage.removeItem(_addressUrl) } else { localStorage.setItem(_addressUrl, 'true') this.queryAddress() + } + if (res.deekseek !== 'true') { + localStorage.removeItem(window.GLOB.sysSign + 'ds') + } else { + localStorage.setItem(window.GLOB.sysSign + 'ds', 'true') } } else if (res.ErrCode === 'N') { localStorage.removeItem(_authUrl) @@ -625,6 +630,10 @@ appkey: appkey } + if (window.GLOB.style_appkey) { + _param.style_appkey = window.GLOB.style_appkey + } + _param.userid = result.UserID _param.LoginUID = result.LoginUID _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') @@ -658,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 || '', @@ -675,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)) { @@ -696,13 +721,7 @@ localStorage.setItem(window.GLOB.sysSign + 'pwdlevel', level) - if (res.srcid) { - localStorage.setItem(window.GLOB.sysSign + 'srcId', res.srcid) - } else { - localStorage.removeItem(window.GLOB.sysSign + 'srcId') - } - - sessionStorage.setItem('home_background', res.index_background_color || '') + res.index_background_color && sessionStorage.setItem('home_background', res.index_background_color) let seconds = 0 if (res.sys_datetime) { @@ -795,6 +814,9 @@ window.location.reload() return } + + window.GLOB.loginOtop = systemMsg.loginOtop + window.GLOB.loginOleft = systemMsg.loginOleft this.setState({ loginWays: login_ways, @@ -1021,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} @@ -1038,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