From 76bf1b4e3d73acab58f5049f3bfc70342c798d22 Mon Sep 17 00:00:00 2001 From: 1178634255 <1178634255@qq.com> Date: Fri, 7 Jul 2023 15:41:14 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/auth/authAdmin.js | 23 +++++ src/layout/components/Navbar.vue | 166 ++++++++++++++++++++++++++++--- src/views/forgetPasswd.vue | 2 +- 3 files changed, 178 insertions(+), 13 deletions(-) diff --git a/src/api/auth/authAdmin.js b/src/api/auth/authAdmin.js index 68f9803..389c614 100644 --- a/src/api/auth/authAdmin.js +++ b/src/api/auth/authAdmin.js @@ -74,4 +74,27 @@ export function updateInv(data) { data: data }); } +//获取当前登陆人用户信息 +export function selectUser(query) { + return axios({ + url: "/admin/auth/admin/selectUser", + method: "get", + params: query + }); +} + +export function modifyPasswd(data) { + return axios({ + url: "/admin/auth/admin/updateUser", + method: "post", + data: data + }); +} +export function filterByUser(query) { + return axios({ + url: "/admin/auth/admin/selectUser", + method: "get", + params: query + }); +} diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index d272e4c..85059c8 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -9,9 +9,8 @@ @@ -119,21 +193,38 @@ import RuoYiDoc from '@/components/RuoYi/Doc' import store from "@/store"; import {filterAllByUser} from "@/api/system/invWarehouse"; import {filterSubByInv, findByDeptUser} from "@/api/system/invSubWarehouse"; -import {updateInv} from "@/api/auth/authAdmin"; +import {updateInv, modifyPasswd,filterByUser} from "@/api/auth/authAdmin"; import {isRelogin} from "@/utils/request"; import router from "@/router"; export default { data() { + let validatePass2 = (rule, value, callback) => { + if (value === "") { + callback(new Error("请再次输入密码")); + } else if (value !== this.inputQuery.password) { + callback(new Error("两次输入密码不一致!")); + } else { + callback(); + } + }; return { - deptName: store.getters.locDeptName, inv: store.getters.locInvName, + deptName: store.getters.locDeptName, selInvVisible: false, + isVisible: false, userInfo: {}, + inputQuery: { + passWord: "", + newPassword: "", + confirmPassword: "", + userName: "", + locInvCode: "", + id:"", + + }, deptList: [], invList: [], - userName: '', - companyName: '', formRules: { locDeptCode: [ {required: true, message: "请选择当前部门", trigger: "blur"} @@ -143,6 +234,14 @@ export default { ], }, + rules: { + password: [{required: true, message: "请输入密码", trigger: "blur"}], + confirmPassword: [ + {required: true, message: "请确认密码", trigger: "blur"}, + {validator: validatePass2, trigger: "blur"}, + ], + + }, }; }, components: { @@ -179,6 +278,33 @@ export default { } }, methods: { + onSubmit(formName) { + this.$refs[formName].validate((valid) => { + if (valid) { + this.loading = true; + modifyPasswd(this.inputQuery).then((response) => { + if (response.code === 20000) { + this.loading = false; + this.$confirm('密码重置成功,请点击确定重新登录', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + location.href = process.env.VUE_APP_CONTEXT_PATH; + }) + }).catch(() => { + }); + } else { + this.$message.error(response.message); + } + }); + } else { + return false; + } + }); + }, + toggleSideBar() { this.$store.dispatch('app/toggleSideBar') }, @@ -197,7 +323,9 @@ export default { changeInv() { this.selInvVisible = true; - this.getDeptList(); + }, + modifyPassword() { + this.isVisible = true; }, getDeptList() { @@ -210,6 +338,16 @@ export default { .catch(() => { }); }, + // getInputQuery() { + // this.inputQuery = []; + // filterByUser() + // .then((response) => { + // this.inputQuery = response.data || []; + // // this.getInvList(); + // }) + // .catch(() => { + // }); + // }, deptChange() { this.getInvList(); @@ -219,8 +357,7 @@ export default { getInvList() { this.invList = []; let query = { - deptCode: this.userInfo.locDeptCode, - type:1 + deptCode: this.userInfo.locDeptCode }; findByDeptUser(query) .then((response) => { @@ -266,6 +403,8 @@ export default { closeDialog() { this.selInvVisible = false; + this.isVisible = false; + this.getDeptList() this.resetForm(); }, @@ -283,14 +422,17 @@ export default { }, created() { this.userName = this.$store.getters.name; - this.companyName = this.$store.getters.companyName; this.userInfo = { id: store.getters.adminId, locInvCode: store.getters.locInvCode, locDeptCode: store.getters.locDeptCode, }; + this.inputQuery = { + userName: this.userName, + id: this.userInfo.id, - + }; + // this.getInputQuery(); this.getDeptList(); //this.getInvList() diff --git a/src/views/forgetPasswd.vue b/src/views/forgetPasswd.vue index e46b70c..52ca03b 100644 --- a/src/views/forgetPasswd.vue +++ b/src/views/forgetPasswd.vue @@ -17,7 +17,7 @@ :model="inputQuery" :rules="rules" ref="inputQuery" - style="margin-left: 20%" + style="margin-left: 20%" > From dd8870adb3d915e25b36c39e78a1905d2d4876d0 Mon Sep 17 00:00:00 2001 From: 1178634255 <1178634255@qq.com> Date: Fri, 7 Jul 2023 18:43:55 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/authUser.vue | 167 ++++++++++++++++------------- 1 file changed, 93 insertions(+), 74 deletions(-) diff --git a/src/views/system/user/authUser.vue b/src/views/system/user/authUser.vue index 8c805e2..7fc018f 100644 --- a/src/views/system/user/authUser.vue +++ b/src/views/system/user/authUser.vue @@ -1,38 +1,42 @@ + + + + + + diff --git a/src/views/inout/IoCheckErrorOrder.vue b/src/views/inout/IoCheckErrorOrder.vue index 6484f0d..9f43bdf 100644 --- a/src/views/inout/IoCheckErrorOrder.vue +++ b/src/views/inout/IoCheckErrorOrder.vue @@ -135,6 +135,8 @@ + + + + + + + + + + + + + +