Browse Source

修改密码

sangwenwei 1 year ago
parent
commit
11ce5e597b
2 changed files with 12 additions and 1 deletions
  1. 10 0
      src/layout/components/userbar.vue
  2. 2 1
      src/views/sys/user/UserInfo.vue

+ 10 - 0
src/layout/components/userbar.vue

@@ -20,6 +20,7 @@
 			</div>
 			<template #dropdown>
 				<el-dropdown-menu>
+					<el-dropdown-item command="pw">修改密码</el-dropdown-item>
 					<el-dropdown-item command="uc">帐号信息</el-dropdown-item>
 					<el-dropdown-item command="clearCache"
 						>清除缓存</el-dropdown-item
@@ -85,6 +86,9 @@
 		</el-drawer>
 	</div>
 	<setting ref="setting"></setting>
+
+	<UpdatePassword ref="updatePassword" :innerVisible="innerVisible" v-on:innerDialog="getInnerStatus($event)"></UpdatePassword>
+
 </template>
 
 <script>
@@ -94,6 +98,7 @@ import loginService from "@/api/auth/loginService";
 import setting from "./../components/setting.vue";
 import notifyService from "@/api/notify/notifyService";
 import config from "@/config";
+import UpdatePassword from "@/views/layout/UpdatePassword2.vue";
 export default {
 	data() {
 		return {
@@ -130,6 +135,7 @@ export default {
 	components: {
 		setting,
 		search,
+		UpdatePassword
 	},
 	computed: {
 		backlogCount(){
@@ -156,6 +162,10 @@ export default {
 		},
 		//个人信息
 		handleUser(command) {
+			if (command == "pw") {
+				console.log(111)
+				this.$refs.updatePassword.init()
+			}
 			if (command == "uc") {
 				this.$router.push({ path: "/sys/user/UserInfo" });
 			}

+ 2 - 1
src/views/sys/user/UserInfo.vue

@@ -435,7 +435,7 @@ export default {
 				photo: "",
 			},
 			pwdForm: {
-				id: "",
+				id: this.$store.state.user.id,
 				oldPassword: "",
 				newPassword: "",
 				confirmNewPassword: "",
@@ -515,6 +515,7 @@ export default {
 			this.$message.success(data);
 		},
 		async submitPwdForm() {
+			console.log(this.pwdForm)
 			let valid = await this.$refs["pwdForm"].validate();
 			if (valid) {
 				const loading = this.$loading();