Procházet zdrojové kódy

单点登录和页面

yuhan před 8 měsíci
rodič
revize
03a3a4a326

+ 125 - 122
src/components/layouts/UserLayout.vue

@@ -1,39 +1,22 @@
 <template>
-  <div id="userLayout" :class="['user-layout-wrapper', device]">
-    <div class="container">
-      <div class="top">
-        <div class="header">
-          <a href="/">
-            <!-- 修改框架 -->
-            <!-- <img src="~@/assets/logo.png" class="logo" alt="logo"> -->
-            <!-- <img src="~@/assets/logo.svg" class="logo" alt="logo"> -->
-            <!-- 修改框架 -->
-            <span class="title">联锁管理平台</span>
-            <!-- <span class="title">Jeecg Boot</span> -->
-          </a>
-        </div>
-        <div class="desc">
-          <!-- 修改框架 -->
-          <!-- Jeecg Boot 是中国最具影响力的 企业级 低代码平台 -->
-        </div>
+  <div class="iot-login">
+    <!-- 头部 -->
+    <div class="login-header">
+      <div class="top-line"></div>
+      <div class="iotmenu-header-content">
+        <span class="iotmenu-header-text">联锁管理平台</span>
       </div>
-
-      <route-view></route-view>
-
-      <div class="footer">
-        <!-- 修改框架 -->
-        <!-- <div class="links">
-          <a href="http://doc.jeecg.com" target="_blank">帮助</a>
-          <a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">隐私</a>
-          <a href="https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE" target="_blank">条款</a>
-        </div> -->
-        <div class="copyright">
-          <!-- 修改框架 -->
-          <!-- Copyright &copy; 2024 山东研讯智能科技有限公司 出品 -->
-          <!-- Copyright &copy; 2019 <a href="http://www.jeecg.com" target="_blank">JEECG开源社区</a> 出品 -->
-        </div>
+    </div>
+    <!--  -->
+    <div class="login-content">
+      <div class="login-box">
+        <route-view></route-view>
       </div>
     </div>
+    <!-- 尾部 -->
+     <div class="login-footer">
+      <div class="login-footer-text">© 1983-2024 Advantech Co., Ltd.</div>
+     </div>
   </div>
 </template>
 
@@ -57,102 +40,122 @@
   }
 </script>
 
-<style lang="less" scoped>
-  #userLayout.user-layout-wrapper {
-    height: 100%;
+<style lang="less">
+@iotTpmFontColor: #323233;
+@iotTpmContentBg: #FAFAFA;
 
-    &.mobile {
-      .container {
-        .main {
-          max-width: 368px;
-          width: 98%;
-        }
-      }
-    }
+@iotHContentHeight: 48px;
+@iotHLineHeight: 8px;
+@iotHHeight: 56px;
 
-    .container {
+.iot-login{
+  .login-header{
+    height: @iotHHeight !important;
+    .top-line{
       width: 100%;
-      min-height: 100%;
-      background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
-      background-size: 100%;
-      padding: 110px 0 144px;
+      height: @iotHLineHeight;
+      background: linear-gradient(90deg,#019ff3,#004280);
+    }
+    .iotmenu-header-content{
+      height: @iotHContentHeight !important;
+      line-height: @iotHContentHeight !important;
+      background-color: #fff !important;
+      color: rgba(0,0,0,65) !important;
+      box-shadow: 0 2px 4px 0 rgba(50,50,51,.5) !important;
+      z-index: 999 !important;
+      padding: 0 !important;
       position: relative;
-
-      a {
-        text-decoration: none;
-      }
-
-      .top {
-        text-align: center;
-
-        .header {
-          height: 44px;
-          line-height: 44px;
-
-          .badge {
-            position: absolute;
-            display: inline-block;
-            line-height: 1;
-            vertical-align: middle;
-            margin-left: -12px;
-            margin-top: -10px;
-            opacity: 0.8;
-          }
-
-          .logo {
-            height: 44px;
-            vertical-align: top;
-            margin-right: 16px;
-            border-style: none;
-          }
-
-          .title {
-            font-size: 33px;
-            color: rgba(0, 0, 0, .85);
-            font-family: "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
-            font-weight: 600;
-            position: relative;
-            top: 2px;
-          }
-        }
-        .desc {
-          font-size: 14px;
-          color: rgba(0, 0, 0, 0.45);
-          margin-top: 12px;
-          margin-bottom: 40px;
-        }
-      }
-
-      .main {
-        min-width: 260px;
-        width: 368px;
-        margin: 0 auto;
-      }
-
-      .footer {
-        position: absolute;
-        width: 100%;
-        bottom: 0;
-        padding: 0 16px;
-        margin: 48px 0 24px;
-        text-align: center;
-
-        .links {
-          margin-bottom: 8px;
-          font-size: 14px;
-          a {
-            color: rgba(0, 0, 0, 0.45);
-            transition: all 0.3s;
-            &:not(:last-child) {
-              margin-right: 40px;
-            }
-          }
-        }
-        .copyright {
-          color: rgba(0, 0, 0, 0.45);
-          font-size: 14px;
+      .user-wrapper{
+        .avatar{
+          margin: 0 10px 0 0 !important;
         }
       }
     }
+    .iotmenu-header-text{
+      font-size: 23px;
+      font-weight: 700;
+      color: #004280;
+      letter-spacing: 1px;
+      margin-left: 30px;
+    }
+  }
+  .login-content{
+    width: 100%;
+    height: calc(100vh - 38px - 56px);
+    // background: url('../../assets/login.png') no-repeat;
+    // background-size: cover;
+    // background-position: center 50%;
+    position: relative;
+    .login-box{
+      width: 400px;
+      min-height: 580px;
+      background-color: #fff;
+      padding: 40px;
+      box-shadow: 0 0 10px rgba(0,0,0,.25);
+      border-radius: 4px;
+      position: absolute;
+      top: 50%;
+      right: 30%;
+      transform: translate(50%, -50%);
+    }
+  }
+  .login-footer{
+    height: 38px;
+    padding-left: 37px;
+    .login-footer-text{
+      color: #a1a1a1;
+      font-size: 14px;
+    }
+  }
+}
+@media (min-width: 1281px){
+  .iot-login .login-content{
+    background: url('../../assets/login.png') no-repeat;
+    background-size: cover;
+    background-position: center 50%;
+    .login-box{
+      right: 30%;
+    }
+  }
+}
+@media (max-width: 1280px){
+  .iot-login .login-content{
+    background: url('../../assets/login1024.png') no-repeat;
+    background-size: cover;
+    background-position: center 50%;
+    .login-box{
+      right: 50%;
+    }
   }
+}
+// @media (max-width: 1919px) and (min-width: 1441px){
+//   .iot-login .login-content .login-box{
+//     left: 55.56%;
+//     right: 16.67%;
+//     top: 22.22%;
+//     bottom: 24.07%;
+//   }
+// }
+// @media (max-width: 1440px) and (min-width: 1367px){
+//   .iot-login .login-content .login-box{
+//     left: 53.15%;
+//     right: 17.57%;
+//     top: 8.33%;
+//     bottom: 8.33%;
+//   }
+// }
+// @media (max-width: 1366px) and (min-width: 1281px){
+//   .iot-login .login-content .login-box{
+//     left: 50%;
+//     right: 18.75%;
+//     top: 8.33%;
+//     bottom: 8.33%;
+//   }
+// }
+// @media (max-width: 1280px){
+//   .iot-login .login-content .login-box{
+//     left: calc(50% - 200px);
+//     top: 108px;
+//   }
+// }
 </style>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 84 - 59
src/permission.js


+ 4 - 1
src/utils/request.js

@@ -17,9 +17,12 @@ let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
 const service = axios.create({
   //baseURL: '/jeecg-boot',
   baseURL: apiBaseUrl, // api base_url
-  timeout: 60000 // 请求超时时间
+  timeout: 60000, // 请求超时时间
+  withCredentials: true,
 })
 
+// axios.defaults.withCredentials = true
+
 const err = (error) => {
   if (error.response) {
     let data = error.response.data

+ 51 - 7
src/views/user/Login.vue

@@ -1,8 +1,10 @@
 <template>
-  <div class="main">
+  <div class="main iot-login-content">
+    <div class="top-img"></div>
+    <div class="sign-text">登录到 联锁管理平台</div>
     <a-form-model class="user-layout-login" @keyup.enter.native="handleSubmit">
-      <a-tabs :activeKey="customActiveKey" :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"  @change="handleTabClick">
-        <a-tab-pane key="tab1" tab="账号密码登录">
+      <a-tabs :activeKey="customActiveKey" :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"  @change="handleTabClick" class="login-tabs">
+        <a-tab-pane key="tab1" tab="SSO">
           <login-account ref="alogin" @validateFail="validateFail" @success="requestSuccess" @fail="requestFailed"></login-account>
         </a-tab-pane>
 
@@ -13,7 +15,7 @@
       </a-tabs>
 
       <a-form-model-item>
-        <a-checkbox @change="handleRememberMeChange" default-checked>自动登录</a-checkbox>
+        <a-checkbox @change="handleRememberMeChange" default-checked>记住我</a-checkbox>
         <!-- 修改框架 -->
         <!-- <router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
           忘记密码
@@ -24,7 +26,7 @@
       </a-form-model-item>
 
       <a-form-item style="margin-top:24px">
-        <a-button size="large"  type="primary"  htmlType="submit"  class="login-button"  :loading="loginBtn"  @click.stop.prevent="handleSubmit" :disabled="loginBtn">确定
+        <a-button size="large"  type="primary"  htmlType="submit"  class="login-button"  :loading="loginBtn"  @click.stop.prevent="handleSubmit" :disabled="loginBtn">登录
         </a-button>
       </a-form-item>
 
@@ -165,7 +167,46 @@ export default {
 
   }
 </script>
+<style lang="less">
+  .login-tabs{
+    .ant-tabs-nav-container{
+      font-size: 16px !important;
+    }
+    .ant-tabs-nav{
+      width: 50%;
+    }
+    .ant-tabs-nav .ant-tabs-tab-active{
+      color: #3395ff !important;
+    }
+    .ant-tabs-ink-bar{
+      width: 100% !important;
+      height: 3px;
+      background: #3395ff;
+    }
+  }
+  .iot-login-content{
+    .ant-checkbox-checked .ant-checkbox-inner{
+      background-color: #3395FF !important;
+      border-color: #3395FF;
+    }
+  }
+</style>
 <style lang="less" scoped>
+  .top-img{
+    width: 100%;
+    height: 64px;
+    background: url('../../assets/login_logo.svg') no-repeat;
+    background-size: 100%;
+  }
+  .sign-text{
+    width: 100%;
+    height: 32px;
+    font-size: 16px;
+    font-weight: 400;
+    color: #646464;
+    margin-top: 8px;
+  }
+
   .user-layout-login {
     label {
       font-size: 14px;
@@ -181,10 +222,13 @@ export default {
     }
 
     button.login-button {
+      width: 100%;
+      height: 40px;
       padding: 0 15px;
       font-size: 16px;
-      height: 40px;
-      width: 100%;
+      background: #004280;
+      font-weight: 700;
+      border-color: transparent;
     }
 
   .user-login-other {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 22 - 17
src/views/user/iotSso/IotSsoLogin.vue