添加md5密码加密
This commit is contained in:
@ -173,11 +173,14 @@ export default {
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate(valid => {
|
||||
if (valid) {
|
||||
let form = Object.assign({}, this.form);
|
||||
if (this.title == '修改密码') {
|
||||
if (this.form.password !== this.password)
|
||||
if (form.password !== this.password)
|
||||
return this.msgError('新旧密码不一致');
|
||||
form.password = this.md5(form.password);
|
||||
form.oldPassword = this.md5(form.oldPassword);
|
||||
}
|
||||
updateInfo(this.form).then(({ message }) => {
|
||||
updateInfo(form).then(({ message }) => {
|
||||
this.msgSuccess(message);
|
||||
// store.commit('SET_NAME', this.form.username);
|
||||
// this.dialogVisible = false;
|
||||
|
@ -434,9 +434,10 @@ export default {
|
||||
Cookies.remove('rememberMe');
|
||||
}
|
||||
if (this.mode) {
|
||||
console.log(this.md5(this.loginForm.password));
|
||||
let loginForm = Object.assign({}, this.loginForm);
|
||||
loginForm.password = this.md5(loginForm.password);
|
||||
this.$store
|
||||
.dispatch('Login', this.loginForm)
|
||||
.dispatch('Login', loginForm)
|
||||
.then(() => {
|
||||
// this.$router.go(-1);
|
||||
this.$router.push({ path: this.redirect || '/' });
|
||||
|
Reference in New Issue
Block a user