chenrui
2025-06-05 61c5d5c0d8d75fdd35d134e3e5276b7b1c36cbf1
src/views/login.vue
@@ -10,7 +10,7 @@
          size="large"
          auto-complete="off"
          placeholder="账号"
          @input="deptListSearch"
          @input="getUserLoginFacotryList"
        >
          <template #prefix><el-icon><User /></el-icon></template>
        </el-input>
@@ -77,7 +77,7 @@
import Cookies from "js-cookie"
import { encrypt, decrypt } from "@/utils/jsencrypt"
import useUserStore from '@/store/modules/user'
import {userDeptList} from "@/api/system/user.js"
import {userLoginFacotryList} from "@/api/system/user.js"
const title = import.meta.env.VITE_APP_TITLE
const userStore = useUserStore()
@@ -169,20 +169,20 @@
  }
}
function deptListSearch() {
function getUserLoginFacotryList() {
  if(loginForm.value.username){
    userDeptList({userName:loginForm.value.username}).then(res => {
    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>