|
|
|
@ -94,6 +94,28 @@
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<el-dialog title="修改密码" :visible.sync="passwordFormVisible" width="85%" top="5vh"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:show-close="false"
|
|
|
|
|
:close-on-press-escape="false">
|
|
|
|
|
<el-form :model="passwordFormData" :rules="passwordFormDataRules" ref="passwordFormData">
|
|
|
|
|
<el-form-item label="原始密码" prop="old_password">
|
|
|
|
|
<el-input type="password" v-model="passwordFormData.oldPassword" auto-complete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<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="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="passwdSubmit()" :loading="passwordLoading">提交
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
position: absolute;
|
|
|
|
@ -125,6 +147,7 @@ import axios from "axios";
|
|
|
|
|
import Cookies from "js-cookie";
|
|
|
|
|
import {decrypt, encrypt} from "@/utils/jsencrypt";
|
|
|
|
|
import {getTitleConfig} from "@/api/login";
|
|
|
|
|
import {forceModifyPasswd, modifyPasswd} from "@/api/auth/authAdmin";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
@ -163,6 +186,12 @@ export default {
|
|
|
|
|
hospName: "",
|
|
|
|
|
title: "福建省XXX医院",
|
|
|
|
|
subTitle: "医院UDI管理系统",
|
|
|
|
|
passwordFormVisible: false,
|
|
|
|
|
passwordFormData: {
|
|
|
|
|
oldPassword: "",
|
|
|
|
|
newPassword: "",
|
|
|
|
|
confirmPassword: "",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
@ -240,24 +269,42 @@ export default {
|
|
|
|
|
Cookies.set("password", encrypt(this.loginForm.password), {
|
|
|
|
|
expires: 30,
|
|
|
|
|
});
|
|
|
|
|
// Cookies.set('rememberMe', this.loginForm.rememberMe, {expires: 30});
|
|
|
|
|
} else {
|
|
|
|
|
Cookies.remove("username");
|
|
|
|
|
Cookies.remove("password");
|
|
|
|
|
// Cookies.remove('rememberMe');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
debugger
|
|
|
|
|
this.$store
|
|
|
|
|
.dispatch("Login", this.loginForm)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.$router
|
|
|
|
|
.push({path: this.redirect || "/"})
|
|
|
|
|
.catch((res) => {
|
|
|
|
|
if (res.data.needChangePwd == true) {
|
|
|
|
|
this.$confirm('系统检测到您的密码长时间未修改,为保证您的账号安全建议立即修改密码?', '提示', {
|
|
|
|
|
confirmButtonText: '立即修改',
|
|
|
|
|
cancelButtonText: '忽略',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.passwordFormVisible = true;
|
|
|
|
|
this.passwordFormData = {
|
|
|
|
|
oldPassword: "",
|
|
|
|
|
newPassword: "",
|
|
|
|
|
confirmPassword: "",
|
|
|
|
|
};
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$router
|
|
|
|
|
.push({path: this.redirect || "/"})
|
|
|
|
|
.catch((res) => {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.$router
|
|
|
|
|
.push({path: this.redirect || "/"})
|
|
|
|
|
.catch((res) => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$refs.checkV.refresh();
|
|
|
|
|
this.$message.error(res);
|
|
|
|
|
if (this.captchaEnabled) {
|
|
|
|
|
this.getCode();
|
|
|
|
@ -278,6 +325,34 @@ 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,
|
|
|
|
|