From 236fdf92ecb6ff876d400f6c360efca8ab085f5c Mon Sep 17 00:00:00 2001 From: odc.xiaohui <xiaohui@Q1> Date: 星期四, 30 十一月 2023 09:04:38 +0800 Subject: [PATCH] 修改青羊后台部门bug --- src/views/login/index.vue | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index f4f3561..37ef440 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -60,6 +60,8 @@ <script> import { mapMutations } from 'vuex' import loginApi from '@/api/login' +import departmentApi from '@/api/department' +import enumItem from '@/store/modules/enumItem' export default { name: 'Login', @@ -79,6 +81,12 @@ } } return { + depart:[], + queryParam: { + level: null, + pageIndex: 1, + pageSize: 100 + }, loginForm: { userName: '', password: '', @@ -131,6 +139,22 @@ this.$refs.password.focus() }) }, + async seachPageDepartMentList () { + let that = this + await departmentApi.pageList(this.queryParam).then(res => { + console.log(res) + if (res.code == 1) { + that.depart = res.response.list + console.log(that.depart) + this.depart.map(item=>{ + item.key = item.id + item.value = item.name + }) + enumItem.state.user.levelEnum = that.depart + + } + }) + }, handleLogin () { let _this = this this.$refs.loginForm.validate(valid => { @@ -138,6 +162,8 @@ this.loading = true loginApi.login(this.loginForm).then(function (result) { if (result && result.code === 1) { + console.log(result) + _this.seachPageDepartMentList() _this.setUserName(_this.loginForm.userName) _this.$router.push({ path: '/' }) } else { -- Gitblit v1.8.0