按钮级别的新版本,多级别的组织架构
loulijun2021
2023-08-15 621bd1e65350d17756863f35783dbab5619a54d4
src/views/login/index.vue
@@ -103,7 +103,7 @@
        <el-button
          :loading="loading"
          type="primary"
          style="width:100%;margin-top:20px;letter-spacing: 10px"
          style="width:100%;margin-top:30px;letter-spacing: 10px;height: 40px;"
          @click.native.prevent="handleLogin"
        >登录
        </el-button>
@@ -143,7 +143,9 @@
<script>
import { validUsername } from '@/utils/validate'
import { getCookie, removeCookie, setCookie } from '@/utils/auth'
import { ForcedOffline } from '@/api/user'
import { ForcedOffline, UserTorgData } from '@/api/user'
import { ButtonData } from '@/api/basicSettings'
import Vue from 'vue'
export default {
  name: 'Login',
@@ -217,11 +219,18 @@
        if (valid) {
          this.loading = true
          this.$store.dispatch('user/login', this.loginForm).then(() => {
            console.log(getCookie('code') === '302', 9999)
            if (getCookie('code') === '302') {
              this.dialogVisible = true
            } else {
              this.$router.push({ path: this.redirect || '/' })
              // ButtonData().then(res => {
              //   localStorage.setItem('ButtonData', JSON.stringify(res.data))
              // })
              // UserTorgData({ usercode: getCookie('usercode') }).then(res => {
              //   setCookie('username', res.data.user)
              //   // sessionStorage.setItem('username', res.data.user)
              //   sessionStorage.setItem('torg', JSON.stringify(res.data.torg))
              // })
            }
            this.loading = false
          }).catch(() => {
@@ -245,7 +254,7 @@
      }
      const res = await ForcedOffline(data)
      if (res.code === '200') {
        this.$message.success('强制下线成功!')
        this.$notify.success('强制下线成功!')
        this.dialogVisible = false
        this.$router.push({ path: this.redirect || '/' })
        // await this.handleLogin()
@@ -440,7 +449,8 @@
    -webkit-text-fill-color: #000 !important;
  }
}
::v-deep .el-dialog__title{
::v-deep .el-dialog__title {
  color: red;
}
@@ -457,6 +467,7 @@
  display: flex;
  justify-content: end;
}
::v-deep .dialogVisible .el-button--primary {
  background-color: #42b983 !important;
  height: 30px;
@@ -466,6 +477,7 @@
  border: none;
  padding: 0 20px;
}
::v-deep .dialogVisible .el-button--default {
  height: 30px;
  display: flex;