aXin-0810 hai 1 ano
pai
achega
522f200627

BIN=BIN
src/assets/login/icon_0001.png


+ 13 - 19
src/layout/components/Navbar.vue

@@ -41,19 +41,13 @@
         </template>
         <el-dropdown class="user-container" trigger="click">
           <div class="user right-menu-item hover-effect">
-            <div class='flex'>
+            <div class="flex">
               <i class="el-icon-user-solid" />
-              <span :class='name.length>5?"ellipsis":""'>{{name}}</span>
+              <span :class="name.length > 5 ? 'ellipsis' : ''">{{ name }}</span>
             </div>
           </div>
           <el-dropdown-menu slot="dropdown" class="user-dropdown">
-            <!-- <router-link to="/" >
-              <el-dropdown-item><a href="https://jiasm.zfire.top/center">业务中台</a></el-dropdown-item>
-            </router-link> -->
-            <el-dropdown-item @click.native="handlePage">
-              <span  style="display: block">业务中台</span>
-            </el-dropdown-item>
-            <router-link :to="{name: 'personal'}">
+            <router-link :to="{ name: 'profile' }">
               <el-dropdown-item>个人信息</el-dropdown-item>
             </router-link>
             <el-dropdown-item divided @click.native="logout">
@@ -132,11 +126,11 @@ export default {
     this.$store.commit('app/SET_L1_PATH', this.path)
   },
   methods: {
-    handlePage(){
+    handlePage() {
       let link = null
       if (process.env.VUE_APP_ENV === 'production') {
         link = 'https://fw.gd-jxm.com/#/home'
-      }else{
+      } else {
         link = 'https://jiasm.zfire.top/center/#/home'
       }
       window.open(link)
@@ -238,17 +232,17 @@ export default {
       }
     }
   }
-  .flex{
+  .flex {
     display: flex;
     align-items: center;
   }
-.ellipsis{
-  display: inline-block;
-  width: (16px * 6);
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-}
+  .ellipsis {
+    display: inline-block;
+    width: (16px * 6);
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
   .right-menu {
     height: 100%;
     line-height: 50px;

+ 4 - 2
src/layout/components/Sidebar/SidebarItem.vue

@@ -3,13 +3,15 @@
     <template v-if="!item.children || !item.children.length">
       <app-link v-if="item.meta" :to="item.path">
         <el-menu-item :index="item.path" :class="{ 'submenu-title-noDropdown': !isNest }">
-          <item :icon="item.meta.icon || (item.meta && item.meta.icon)" :title="item.meta.title" />
+          <item :title="item.meta.title" />
+          <!-- <item :icon="item.meta.icon || (item.meta && item.meta.icon)" :title="item.meta.title" /> -->
         </el-menu-item>
       </app-link>
     </template>
     <el-submenu v-else ref="subMenu" :index="item.path" popper-append-to-body>
       <template slot="title">
-        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
+        <item v-if="item.meta" :title="item.meta.title" />
+        <!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" /> -->
       </template>
       <template v-for="child in item.children">
         <sidebar-item v-if="child.status" :key="child.name" :is-nest="true" :item="child" class="nest-menu" />

+ 92 - 50
src/views/login/index.vue

@@ -1,15 +1,20 @@
 <template>
   <div class="login-container">
-    <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
+    <el-form
+      ref="loginForm"
+      :model="loginForm"
+      :rules="loginRules"
+      class="login-form"
+      auto-complete="on"
+      label-position="left"
+    >
       <div class="image-container">
-        <img src="@/assets/login/image.png" alt="">
+        <img src="@/assets/login/image.png" alt="" />
       </div>
       <div class="right-container">
         <div class="empty-height" />
         <div class="form-container">
-          <div class="title">
-            售修宝平台
-          </div>
+          <div class="title">售修宝平台</div>
           <el-form-item prop="username">
             <span class="svg-container">
               <svg-icon icon-class="user" />
@@ -59,7 +64,7 @@
               auto-complete="off"
               @keyup.enter.native="handleLogin"
             />
-            <div class="code" @click="getCode"><img :src="'data:image/jpeg;base64,' + codeImage" alt=""></div>
+            <div class="code" @click="getCode"><img :src="'data:image/jpeg;base64,' + codeImage" alt="" /></div>
           </el-form-item>
 
           <el-checkbox v-model="isRemenberPw">记住密码</el-checkbox>
@@ -70,6 +75,17 @@
         </div>
       </div>
     </el-form>
+    <div class="info">
+      <div class="info-item">
+        <el-link href="https://beian.miit.gov.cn/" :underline="false" target="_blank">粤ICP备2020090308号 </el-link>
+        <div style="margin: 0 20px">|</div>
+        <el-link href="https://beian.mps.gov.cn/#/query/webSearch" :underline="false" target="_blank">
+          <el-image style="width: 14px; height: 16px" :src="require('@/assets/login/icon_0001.png')" />
+          粤公网安备44010602008477号
+        </el-link>
+      </div>
+      <div>Copyright © 2014-2023 广州众炬科技有限公司 互联网技术开发</div>
+    </div>
   </div>
 </template>
 
@@ -112,18 +128,18 @@ export default {
       loginRules: {
         username: [{ required: true, trigger: 'change', validator: validateUsername }],
         password: [{ required: true, trigger: 'change', validator: validatePassword }],
-        codeValue: [{ required: true, trigger: 'change', validator: validateCode }],
+        codeValue: [{ required: true, trigger: 'change', validator: validateCode }]
       },
       loading: false,
       passwordType: 'password',
       redirect: undefined,
       isRemenberPw: false,
-      codeImage: '',
+      codeImage: ''
     }
   },
   watch: {
     $route: {
-      handler: function(route) {
+      handler: function (route) {
         this.redirect = route.query && route.query.redirect
       },
       immediate: true
@@ -131,24 +147,24 @@ export default {
   },
   created() {
     // 获取缓存信息
-    if(localStorage.getItem("greemall_login")) {
-      let storageData = JSON.parse(localStorage.getItem("greemall_login"));
-      this.loginForm.username = storageData.username;
-      this.isRemenberPw = storageData.isRemenberPw;
+    if (localStorage.getItem('greemall_login')) {
+      let storageData = JSON.parse(localStorage.getItem('greemall_login'))
+      this.loginForm.username = storageData.username
+      this.isRemenberPw = storageData.isRemenberPw
     }
-    if(this.isRemenberPw) {
-      this.getCookie();
+    if (this.isRemenberPw) {
+      this.getCookie()
     }
 
-    this.getCode();
+    this.getCode()
   },
   methods: {
     // 获取验证码
     getCode() {
       getCode().then(res => {
-        console.log(res);
-        this.loginForm.code = res.data.code;
-        this.codeImage = res.data.pic;
+        console.log(res)
+        this.loginForm.code = res.data.code
+        this.codeImage = res.data.pic
       })
     },
 
@@ -169,15 +185,18 @@ export default {
       this.$refs.loginForm.validate(valid => {
         if (valid) {
           this.loading = true
-          this.$store.dispatch('user/login', this.loginForm).then(() => {
-            this.$router.push({ path: this.redirect || '/' })
-            this.saveUnAndPw();
-            this.loading = false
-          }).catch(() => {
-            this.getCode();
-            this.loginForm.codeValue = '';
-            this.loading = false
-          })
+          this.$store
+            .dispatch('user/login', this.loginForm)
+            .then(() => {
+              this.$router.push({ path: this.redirect || '/' })
+              this.saveUnAndPw()
+              this.loading = false
+            })
+            .catch(() => {
+              this.getCode()
+              this.loginForm.codeValue = ''
+              this.loading = false
+            })
         } else {
           console.log('error submit!!')
           return false
@@ -191,43 +210,42 @@ export default {
         username: this.loginForm.username,
         isRemenberPw: this.isRemenberPw
       }
-      localStorage.setItem("greemall_login", JSON.stringify(storageData));
+      localStorage.setItem('greemall_login', JSON.stringify(storageData))
 
-      if(this.isRemenberPw) {
-        this.setCookie(this.loginForm.username, this.loginForm.password, 7);
+      if (this.isRemenberPw) {
+        this.setCookie(this.loginForm.username, this.loginForm.password, 7)
       }
     },
 
     //设置cookie
     setCookie(c_name, c_pwd, exdays) {
-      var exdate = new Date(); //获取时间
-      exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); //保存的天数
+      var exdate = new Date() //获取时间
+      exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays) //保存的天数
       //字符串拼接cookie
-      window.document.cookie = "greemall_username" + "=" + c_name + ";path=/;expires=" + exdate.toGMTString();
-      window.document.cookie = "greemall_password" + "=" + c_pwd + ";path=/;expires=" + exdate.toGMTString();
+      window.document.cookie = 'greemall_username' + '=' + c_name + ';path=/;expires=' + exdate.toGMTString()
+      window.document.cookie = 'greemall_password' + '=' + c_pwd + ';path=/;expires=' + exdate.toGMTString()
     },
 
     //读取cookie
-    getCookie: function() {
+    getCookie: function () {
       if (document.cookie.length > 0) {
-        var arr = document.cookie.split('; '); //这里显示的格式需要切割一下自己可输出看下
+        var arr = document.cookie.split('; ') //这里显示的格式需要切割一下自己可输出看下
         for (var i = 0; i < arr.length; i++) {
-          var arr2 = arr[i].split('='); //再次切割
+          var arr2 = arr[i].split('=') //再次切割
           //判断查找相对应的值
           if (arr2[0] == 'greemall_username') {
-            this.loginForm.username = arr2[1]; //保存到保存数据的地方
+            this.loginForm.username = arr2[1] //保存到保存数据的地方
           } else if (arr2[0] == 'greemall_password') {
-            this.loginForm.password = arr2[1];
+            this.loginForm.password = arr2[1]
           }
         }
       }
     },
 
     //清除cookie
-    clearCookie: function() {
-      this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
+    clearCookie: function () {
+      this.setCookie('', '', -1) //修改2值都为空,天数为负1天就好了
     }
-
   }
 }
 </script>
@@ -236,8 +254,8 @@ export default {
 /* 修复input 背景不协调 和光标变色 */
 /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
 
-$bg:#283443;
-$light_gray:#fff;
+$bg: #283443;
+$light_gray: #fff;
 $cursor: #fff;
 $back: #333;
 
@@ -293,9 +311,9 @@ $back: #333;
 </style>
 
 <style lang="scss" scoped>
-$bg:#2d3a4b;
-$dark_gray:#889aa4;
-$light_gray:#eee;
+$bg: #2d3a4b;
+$dark_gray: #889aa4;
+$light_gray: #eee;
 
 .login-container {
   min-height: 100%;
@@ -356,7 +374,7 @@ $light_gray:#eee;
 
   .svg-container {
     padding: 6px 5px 6px 5px;
-    color: #33AEF7;
+    color: #33aef7;
     vertical-align: middle;
     width: 30px;
     display: inline-block;
@@ -400,7 +418,7 @@ $light_gray:#eee;
       height: 45px;
       border-radius: 45px;
       background: #33aef7;
-      box-shadow: 2px 3px 8px 0px rgba(5,155,245,0.75);
+      box-shadow: 2px 3px 8px 0px rgba(5, 155, 245, 0.75);
     }
   }
 }
@@ -413,4 +431,28 @@ $light_gray:#eee;
     border-radius: 15px !important;
   }
 }
+
+.info {
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+  justify-content: center;
+  margin-top: 50px;
+  line-height: 30px;
+  text-align: center;
+  text-align-last: center;
+  color: #fff;
+  z-index: 999;
+  ::v-deep .el-link--inner {
+    color: #fff;
+    font-weight: initial;
+  }
+}
+
+.info-item {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: #fff;
+}
 </style>