登录密码验证

dev_ksck2.0
anthonywj 12 months ago
parent 51bd03f4a7
commit eaf4b616ab

@ -74,6 +74,15 @@ export function modifyPasswd(data) {
});
}
export function forceModifyPasswd(data) {
return axios({
url: "/admin/auth/admin/force/updateUser",
method: "post",
data: data
});
}
export function filterByUser(query) {
return axios({
url: "/admin/auth/admin/selectUser",

@ -98,7 +98,6 @@
</el-card>
</el-form>
<el-dialog title="修改密码" :visible.sync="passwordFormVisible" width="85%" top="5vh"
:close-on-click-modal="false"
:show-close="false"
@ -110,13 +109,13 @@
<el-form-item label="新密码" prop="new_password">
<el-input type="password" v-model="passwordFormData.newPassword" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="check_new_password">
<el-input type="password" v-model="passwordFormData.check_new_password" auto-complete="off"></el-input>
<el-form-item label="确认密码" prop="confirmPassword">
<el-input type="password" v-model="passwordFormData.confirmPassword" auto-complete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click.native="passwordFormVisible = !passwordFormVisible">取消</el-button> -->
<el-button type="primary" @click.native="addSubmit('passwordFormData')" :loading="passwordLoading">提交
<el-button type="primary" @click.native="passwdSubmit()" :loading="passwordLoading">提交
</el-button>
</div>
</el-dialog>
@ -142,6 +141,7 @@ import axios from "axios";
import Cookies from "js-cookie";
import {decrypt, encrypt} from "@/utils/jsencrypt";
import {getCodeImg, getTitleConfig} from "@/api/login";
import {forceModifyPasswd, modifyPasswd} from "@/api/auth/authAdmin";
export default {
data() {
@ -187,7 +187,7 @@ export default {
passwordFormData: {
oldPassword: "",
newPassword: "",
check_new_password: "",
confirmPassword: "",
},
};
},
@ -337,7 +337,7 @@ export default {
this.passwordFormData = {
oldPassword: "",
newPassword: "",
check_new_password: "",
confirmPassword: "",
};
}).catch(() => {
this.$router
@ -352,8 +352,6 @@ export default {
.catch((res) => {
});
}
})
.catch((res) => {
this.loading = false;
@ -377,10 +375,41 @@ export default {
this.subTitle = res.data.subTitle;
});
},
},
passwdSubmit() {
if (this.passwordFormData.newPassword != this.passwordFormData.confirmPassword) {
this.$message.error("新密码与确认密码不一致!!!!");
return
}
if (this.passwordFormData.passWord == this.passwordFormData.newPassword) {
this.$message.error("旧密码与新密码不能相同!!!!");
return
}
this.loading = true;
forceModifyPasswd(this.passwordFormData).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);
}
});
},
}
,
components: {
Verify,
},
}
,
created() {
//
let query = this.$route.query;
@ -394,8 +423,10 @@ export default {
});
this.getCookie();
},
};
}
,
}
;
</script>
<style type="text/scss" lang="scss">

Loading…
Cancel
Save