-
+
-
+
-
+
@@ -116,6 +100,7 @@ export default {
newpassword2: "",
avatar: "",
phone: "",
+ userId:'',
},
rules: {
phone: [{ required: false, validator: validatePhone, trigger: "blur" }],
@@ -155,13 +140,25 @@ export default {
if (!valid) {
return false;
}
- editInfo(this.ruleForm).then((response) => {
- this.$notify.success("修改成功");
- // 修改后注销当前token,重新登录
- this.$store.dispatch("LogOut").then(() => {
+ this.$api.api.resetPassword({
+ userId:this.ruleForm.userId,
+ password:this.ruleForm.newpassword1
+ }).then((res) => {
+ // console.log(res);
+
+ this.$notify.success("修改成功");
+ this.$store.dispatch("LogOut").then(() => {
location.reload();
+ });
+
});
- });
+ // editInfo(this.ruleForm).then((response) => {
+ // this.$notify.success("修改成功");
+ // // 修改后注销当前token,重新登录
+ // this.$store.dispatch("LogOut").then(() => {
+ // location.reload();
+ // });
+ // });
});
},
resetForm() {
@@ -171,6 +168,7 @@ export default {
this.ruleForm.username = this.userInfo.username;
this.ruleForm.phone = this.userInfo.phone;
this.ruleForm.avatar = this.userInfo.avatar;
+ this.ruleForm.userId = this.userInfo.userId;
handleImg(this.userInfo.avatar, "avatar");
//判断是否选择了租户ID
const TENANT_ID = getStore({ name: "tenantId" });