zpj 1 rok temu
rodzic
commit
4735dc09e5

+ 1 - 1
src/api/login.js

@@ -1,4 +1,4 @@
 import request from '@/utils/request'
 
 
-export const login = (data) => request( 'login', 'post', { ...data },false)
+export const login = (data) => request( '/auth/login', 'post', { ...data },false)

+ 0 - 5
src/layout/components/AppMain.vue

@@ -1,8 +1,5 @@
 <template>
   <section class="app-main">
-    <!--    <div class="app-main-text" v-if="key === '/'">-->
-    <!--      <CountView></CountView>-->
-    <!--    </div>-->
     <transition name="fade-transform" mode="out-in">
       <router-view :key="key" />
     </transition>
@@ -10,7 +7,6 @@
 </template>
 
 <script>
-// import CountView from '../count/index.vue'
 export default {
   name: 'AppMain',
   computed: {
@@ -18,7 +14,6 @@ export default {
       return this.$route.path
     }
   }
-  // components: { CountView }
 }
 </script>
 

+ 2 - 21
src/layout/components/Navbar.vue

@@ -6,9 +6,7 @@
     <div class="nav-right align-items-center animate__animated animate__bounceInRight">
       <el-dropdown trigger="click">
         <span class="user-box border-l-D7DCE9 align-items-center">
-          <img v-if="head_img" class="user-img mr-16 " :src="head_img" alt="">
-          <img v-else class="user-img mr-16" src="#" alt="">
-          <div class="fs-16 fw-700 fc-111827">{{ name ? name : '管理员' }}</div>
+          <div class="fs-16 fw-700 fc-111827">管理员</div>
           <i class="el-icon-arrow-down el-icon--right" />
         </span>
         <el-dropdown-menu slot="dropdown">
@@ -24,7 +22,6 @@
 
 <script>
 import { mapGetters } from 'vuex'
-// import { getMemberInfo } from '@/api/user'
 
 export default {
   computed: {
@@ -35,8 +32,6 @@ export default {
   },
   data() {
     return {
-      name: '',
-      head_img: '',
       titleName: '',
     }
   },
@@ -46,24 +41,10 @@ export default {
     }
   },
   mounted() {
-    this.name = localStorage.getItem('userName')
-    this.head_img = localStorage.getItem('head_img')
-    if (!this.name) {
-      // this.getMemberInfo()
-    }
+
     this.getBreadcrumb()
   },
   methods: {
-    getMemberInfo() {
-      getMemberInfo().then((res) => {
-        if (res.code === 0) {
-          this.name = res.data.name
-          this.head_img = res.data.head_img
-          localStorage.setItem('userName',res.data.name)
-          localStorage.setItem('head_img',res.data.head_img)
-        }
-      })
-    },
     getBreadcrumb() {
       const matched = this.$route.matched.filter(item => item.meta && item.meta.title)
       const levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)

+ 4 - 6
src/layout/components/Sidebar/Logo.vue

@@ -3,11 +3,10 @@
 
     <transition name="sidebarLogoFade">
       <div class="logo-box-if animate__animated animate__bounceInLeft" v-if="collapse" >
-            <img v-if="logo" src="#" class="logo-img">
+            E
       </div>
       <div class="align-items-center logo-box-else animate__animated animate__bounceInLeft" v-else>
-            <img v-if="logo" src="#" class="logo-img">
-            <div class="fs-16 ml-8 fw-800 fc-111827">管理系统</div>
+            <div class="fs-16 ml-8 fw-800 fc-111827">E签宝管理系统</div>
       </div>
     </transition>
   </div>
@@ -24,8 +23,7 @@ export default {
   },
   data() {
     return {
-      title: 'Vue Admin Template',
-      logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
+
     }
   }
 }
@@ -35,7 +33,7 @@ export default {
   .logo-box {
     padding: 32px 0 32px 0;
     box-sizing: border-box;
-    //justify-content: center;
+
     .logo-img {
       width: 32px;
       height: 32px;

+ 2 - 14
src/layout/index.vue

@@ -5,11 +5,7 @@
     <sidebar class="sidebar-container" :themeType="themeType"/>
     <div class="main-container">
       <div :class="{'fixed-header':fixedHeader}">
-        <navbar @themeColor="themeColor"/>
-        <!--        <div class="box-title">-->
-        <!--          <breadcrumb v-if="key !== '/'" class="breadcrumb-container" />-->
-        <!--          <div v-else class="wel-text">欢迎进入管理系统</div>-->
-        <!--        </div>-->
+        <navbar />
       </div>
       <app-main/>
     </div>
@@ -75,15 +71,7 @@ export default {
         this.themeType = '1'
       }
     },
-    themeColor(data) {
-      const type = localStorage.getItem('themeType')
-      if (data === type) {
-        return
-      }
-      this.themeType = data
-      localStorage.setItem('themeType', data)
-      // console.log(this.themeType, '1蓝2绿3红')
-    },
+
     handleClickOutside() {
       this.$store.dispatch('app/closeSideBar', {
         withoutAnimation: false

+ 2 - 25
src/utils/tools.js

@@ -7,34 +7,11 @@ const tools = {}
  * @param type
  */
 tools.setLoginData = function(data) {
-  window.localStorage.setItem('m_id', data.m_id)
+  window.localStorage.setItem('u_id', data.u_id)
   window.localStorage.setItem('token', data.token)
-  window.localStorage.setItem('status', data.status)
-  window.localStorage.setItem('ministerType', data.ministerType)
-  window.localStorage.setItem('receivingType', data.receivingType)
-  window.localStorage.setItem('enteringType', data.enteringType)
 }
 /**
- * 设置权限ID
- * @param permissionIds
- */
-tools.setPermissionIds = function(permissionIds) {
-  window.localStorage.setItem('permissionIds', permissionIds)
-}
-/**
- * 获取权限ID
- * @returns {string[]}
- */
-tools.getPermissionIds = function() {
-  let permissionIds = window.localStorage.getItem('permissionIds')
-  if (!permissionIds) {
-    permissionIds = []
-  }
-  if (typeof permissionIds === 'string') {
-    permissionIds = permissionIds.split(',')
-  }
-  return permissionIds
-}
+
 
 
 /**

+ 1 - 1
src/views/admin/index/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-      11111111111231323211212
+      预留首页备用
   </div>
 </template>
 

+ 21 - 99
src/views/login/login.vue

@@ -7,25 +7,16 @@
     </div>
     <div class="login-right box-sizing-border flex-direction animate__animated animate__fadeInDown">
 
-      <div class="fs-30 fw-500 fc-0A1629 mb-40 text-align-center">管理系统</div>
-      <div class="tag-box">
-        <tagList :tag-list="tabData" box-background="#fff" @tabSwitch="tabSwitch" />
-      </div>
-      <div class="login-input" :class="styleType === 1?'animate__animated animate__headShake':''">
+      <div class="fs-30 fw-500 fc-0A1629 mb-40 text-align-center">E签宝管理系统</div>
+      <div class="login-input">
         <div class="fc-7D8592 mb-8 ml-8 fs-14">账号</div>
-        <el-input v-model="loginForm.phone" placeholder="请输入手机号" />
+        <el-input v-model="loginForm.account" placeholder="请输入账号" />
       </div>
-      <div v-show="loginForm.tabType === 0" class="login-input"
-        :class="styleType === 2?'animate__animated animate__headShake':'animate__animated animate__flipInX'">
+      <div  class="login-input animate__animated animate__headShake">
         <div class="fc-7D8592 mb-8 ml-8 fs-14">密码</div>
         <el-input v-model="loginForm.password" placeholder="请输入密码" show-password />
       </div>
-      <div v-show="loginForm.tabType === 1" class="login-input"
-        :class="styleType === 3?'animate__animated animate__headShake':'animate__animated animate__flipInX'">
-        <div class="fc-7D8592 mb-8 ml-8 fs-14">验证码</div>
-        <el-input v-model="loginForm.code" type="number" placeholder="请输入验证码" />
-        <div class="fs-14 fc-3F8CFF get-code-c cursor" @click="getCode">{{ codeText }}</div>
-      </div>
+
       <div class="remember login-input flex-justify-space pt-10">
         <div class="align-items-center">
           <input v-model="hobby" class="mr-14" type="checkbox" value="true">
@@ -33,52 +24,35 @@
           <div class="fc-7D8592 fs-16">记住我</div>
         </div>
       </div>
-      <div class="login-but baC-2B7DFA fc-fff fs-16 text-align-center sys-radius-15 cursor" @click="toLogin">立即登录
-      </div>
+      <div class="login-but baC-2B7DFA fc-fff fs-16 text-align-center sys-radius-15 cursor" @click="toLogin">立即登录</div>
     </div>
   </div>
 </template>
 
 <script>
-  import getCheckCode from './module/getCheckCode.vue'
-  import tagList from '@/components/tagList/TagList'
   import tools from '@/utils/tools'
-  import {
-    commonSend
-  } from '@/api/conmmon.js'
+
   import {
     login
   } from '@/api/login'
-  import {
-    GetUserPermission
-  } from "@/api/user";
+
 
   export default {
-    components: {
-      getCheckCode,tagList
-    },
+
     data() {
       return {
         checked: '',
         num: 1,
         loginForm: {
-          phone: '',
+          account: '',
           password: '',
-          code: '',
-          tabType: 0 // 0,密码登录 1,验证码登录
         },
-        tabData: [{
-          title: '密码登录',
-          'type': 0
-        }, {
-          title: '验证码登录',
-          'type': 1
-        }],
+
         hobby: false,
         passwordType: 'password',
         styleType: 0,
-        codeText: '获取验证码',
-        time: 60,
+        swiperId:0,
+
         carouselList: [{
             url: require('@/assets/img/login/bg.png')
           },
@@ -86,16 +60,13 @@
             url: require('@/assets/img/login/bg-two.png')
           }
         ],
-        swiperId: 0,
-        timer: ''
+
       }
     },
     mounted() {
       this.swiper()
     },
-    beforeDestroy() {
-      clearInterval(this.timer)
-    },
+
     methods: {
       swiper() {
         this.timer = setInterval(() => {
@@ -105,25 +76,7 @@
           }
         }, 5000)
       },
-      getCode() {
-        this.loginForm.smsType = "login"
-        commonSend(this.loginForm).then((res) => {
-          if (res.code === 0) {
-            this.popFun('成功', '获取短信验证码成功', 'success')
-            const timer = setInterval(() => {
-              this.time--
-              this.codeText = this.time + '秒'
-              if (this.time === 0) {
-                this.time = 60
-                clearInterval(timer)
-                this.codeText = '获取验证码'
-              }
-            }, 5000)
-          } else {
-            tools.error(res.msg)
-          }
-        })
-      },
+
       // 查看密码输入
       showPwd() {
         if (this.passwordType === 'password') {
@@ -132,36 +85,15 @@
           this.passwordType = 'password'
         }
       },
-      // tab切换
-      tabSwitch(item) {
-        this.styleType = item.type
-        this.loginForm.tabType = item.type
-        this.loginForm.phone = ''
-        this.loginForm.password = ''
-      },
-      forget() {
-        this.$router.push('/backPassword')
-      },
+
       toLogin() {
         this.styleType = 0
         if (this.verification()) {
-          if (this.loginForm.tabType === 0) {
-            delete this.loginForm.code
-          } else {
-            delete this.loginForm.password
-          }
+
           login(this.loginForm).then((res) => {
-            if (res.code === 0) {
+            if (res.code === 1) {
               tools.setLoginData(res.data)
-              // this.$router.push('/')
-              GetUserPermission().then((res) => {
-                if (res.code === 0) {
-                  tools.setPermissionIds(res.data)
-                  this.$router.push('/')
-                } else {
-                  this.$notify.error(res.msg)
-                }
-              })
+              this.$router.push('/')
             } else {
               this.$notify.error(res.msg)
             }
@@ -169,17 +101,7 @@
         }
       },
       verification() {
-        const reg_tel = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/
-        if (this.loginForm.phone === '') {
-          this.popFun('提示', '请输入手机号', 'error')
-          this.styleType = 1
-          return false
-        }
-        if (!reg_tel.test(this.loginForm.phone)) {
-          this.popFun('提示', '请输入正确的手机号', 'error')
-          this.styleType = 1
-          return false
-        }
+
         if (this.loginForm.tabType === 0) {
           if (this.loginForm.password === '') {
             this.popFun('提示', '请输入密码', 'error')

+ 1 - 2
vue.config.js

@@ -41,8 +41,7 @@ module.exports = {
     },
     proxy: {
       '/adminApi/': {
-        // target: 'http://127.0.0.1:8001',
-        target: 'https://whgo.lcpcp.cc',
+        target: 'https://testsign.jhcs888.com/',
         changeOrigin: true // 只有这个值为true的情况下 才表示开启跨域
       }
     }