按钮级别的新版本,多级别的组织架构
loulijun2021
2023-08-09 1ec6e15f8a7d351ce8537567cf6e956e99d4167f
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>
@@ -144,6 +144,8 @@
import { validUsername } from '@/utils/validate'
import { getCookie, removeCookie, setCookie } from '@/utils/auth'
import { ForcedOffline } from '@/api/user'
import { ButtonData } from '@/api/basicSettings'
import Vue from 'vue'
export default {
  name: 'Login',
@@ -217,11 +219,14 @@
        if (valid) {
          this.loading = true
          this.$store.dispatch('user/login', this.loginForm).then(() => {
            console.log(getCookie('code') === '302', 9999)
            // console.log(getCookie('code') === '302', 9999)
            if (getCookie('code') === '302') {
              this.dialogVisible = true
            } else {
              this.$router.push({ path: this.redirect || '/' })
              ButtonData().then(res => {
                sessionStorage.setItem('ButtonData', JSON.stringify(res.data))
              })
            }
            this.loading = false
          }).catch(() => {
@@ -235,6 +240,7 @@
    },
    dialogVisibleCancel() {
      // localStorage.removeItem('token')
      this.dialogVisible = false
    },
    async dialogVisibleConfirm() {
@@ -244,7 +250,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()