src/views/login.vue
@@ -10,7 +10,6 @@
          size="large"
          auto-complete="off"
          placeholder="账号"
          @input="getUserLoginFacotryList"
        >
          <template #prefix><el-icon><User /></el-icon></template>
        </el-input>
@@ -27,11 +26,6 @@
        >
          <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
        </el-input>
      </el-form-item>
      <el-form-item prop="currentFatoryId">
        <el-select v-model="loginForm.currentFatoryId" placeholder="请选择公司" >
          <el-option  v-for="item in factoryList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
        </el-select>
      </el-form-item>
<!--      <el-form-item prop="code" v-if="captchaEnabled">-->
<!--        <el-input-->
@@ -77,7 +71,6 @@
import Cookies from "js-cookie"
import { encrypt, decrypt } from "@/utils/jsencrypt"
import useUserStore from '@/store/modules/user'
import {userLoginFacotryList} from "@/api/system/user.js"
const title = import.meta.env.VITE_APP_TITLE
const userStore = useUserStore()
@@ -89,7 +82,6 @@
  username: "",
  password: "",
  rememberMe: false,
  currentFatoryId:'',
})
const loginRules = {
@@ -105,9 +97,6 @@
// 注册开关
const register = ref(false)
const redirect = ref(undefined)
const factoryList = ref([])
const currentFatoryId = ref('')
watch(route, (newRoute) => {
    redirect.value = newRoute.query && newRoute.query.redirect
@@ -162,20 +151,8 @@
  }
}
function getUserLoginFacotryList() {
  if(loginForm.value.username){
    userLoginFacotryList({userName:loginForm.value.username}).then(res => {
      console.log('res', res)
      factoryList.value = res.data
    })
  }else {
    factoryList.value = []
  }
}
getCode()
getCookie()
getUserLoginFacotryList()
</script>
<style lang='scss' scoped>