保安服务企业管理项目备份
guoshilong
2024-01-03 e747a23e38f1db8924b90af6ea90a29fd5a0058a
登录修改
2 files modified
38 ■■■■ changed files
src/page/login/userlogin.vue 34 ●●●●● patch | view | raw | blame | history
src/store/modules/user.js 4 ●●● patch | view | raw | blame | history
src/page/login/userlogin.vue
@@ -49,6 +49,7 @@
import {info} from "@/api/system/tenant"
import {getCaptcha} from "@/api/user"
import {getTopUrl} from "@/util/util"
import {Message} from "element-ui";
export default {
  name: "userlogin",
@@ -120,22 +121,25 @@
          })
          this.$store
            .dispatch("LoginByUsername", this.loginForm)
            .then(() => {
              console.log("userInfo",this.userInfo)
              this.$store.dispatch("GetMenu", [this.userInfo, ""]).then((data) => {
                //登录跳转首页改完跳转保安单位情况智能分析
                let path = this.tagWel.value
                let menu = data.filter(e => e.path == "/securityAnalysis/index")
                if (menu.length > 0) {
                  path = '/securityAnalysis'
                }
                if (this.userInfo.role_name.indexOf("考勤管理员") > -1) {
                  path = "check/record"
                }
                this.$router.push({path: path})
            .then((data) => {
              if (data.error_description) {
                loading.close()
              });
              }else{
                this.$store.dispatch("GetMenu", [this.userInfo, ""]).then((data) => {
                  //登录跳转首页改完跳转保安单位情况智能分析
                  let path = this.tagWel.value
                  let menu = data.filter(e => e.path == "/securityAnalysis/index")
                  if (menu.length > 0) {
                    path = '/securityAnalysis'
                  }
                  if (this.userInfo.role_name.indexOf("考勤管理员") > -1) {
                    path = "check/record"
                  }
                  this.$router.push({path: path})
                  loading.close()
                });
              }
            })
            .catch(() => {
              loading.close()
src/store/modules/user.js
@@ -50,9 +50,7 @@
    LoginByUsername({ commit }, userInfo) {
      return new Promise((resolve, reject) => {
        loginByUsername(userInfo.tenantId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => {
          // debugger;
          const data = res.data;
          // console.log(res.data, 'datadatadatadatadata')
          if (data.error_description) {
            Message({
              message: data.error_description,
@@ -66,7 +64,7 @@
            commit('DEL_ALL_TAG');
            commit('CLEAR_LOCK');
          }
          resolve();
          resolve(data);
        }).catch(error => {
          reject(error);
        })