king
2025-04-03 ff9cdf2b63070f01b375ac93c0e3b2975548ec14
src/views/login/index.jsx
@@ -599,6 +599,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 || '',
@@ -616,7 +630,9 @@
              navBar: res.menu_type, // shutter 百叶窗、linkage_navigation 联动菜单、linkage 联动菜单_无导航栏、menu_board 菜单面板、menu_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)) {
@@ -730,6 +746,9 @@
              window.location.reload()
              return
            }
            window.GLOB.loginOtop = systemMsg.loginOtop
            window.GLOB.loginOleft = systemMsg.loginOleft
            
            this.setState({
              loginWays: login_ways,
@@ -903,8 +922,20 @@
  render () {
    const { lineColor, bgImage, loginlogo, copyRight, webSite, ICP, loginWays } = 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" style={bgImage ? {backgroundImage: 'url(' + bgImage + ')'} : {}}>
      <div className="login-container" id="mk-login-view" style={wrapStyle}>
        <div className="logo" style={lineColor ? {borderColor: lineColor} : {}}>
          {loginlogo ? <img src={loginlogo} alt=""/> : null}
          {this.state.platName ? <p className="plat-name">{this.state.platName}</p> : null}