fix: 修复 LDAP 测试登录没有加密的bug

This commit is contained in:
Captain.B 2021-03-16 18:17:24 +08:00
parent 003284b979
commit 43e14da7c3
1 changed files with 8 additions and 2 deletions

View File

@ -60,7 +60,7 @@
<script>
import MsDialogFooter from "../../common/components/MsDialogFooter";
import {listenGoBack, removeGoBackListener} from "../../../../common/js/utils";
import {listenGoBack, publicKeyEncrypt, removeGoBackListener} from "../../../../common/js/utils";
export default {
name: "LdapSetting",
@ -204,9 +204,15 @@ export default {
})
},
login(form) {
let publicKey = localStorage.getItem("publicKey");
this.$refs[form].validate(valid => {
if (valid) {
this.result = this.$post("/ldap/test/login", this.loginForm, () => {
let form = {
username: publicKeyEncrypt(this.loginForm.username, publicKey),
password: publicKeyEncrypt(this.loginForm.password, publicKey),
};
this.result = this.$post("/ldap/test/login", form, () => {
this.$success(this.$t('ldap.login_success'));
});
} else {