提交 5eb06f8e 编写于 作者: zhangpingchuan's avatar zhangpingchuan

feat: 增加验证码、密码加密功能

上级 a21336b7
......@@ -99,7 +99,7 @@ export const ChangePassword = defineComponent({
try {
loading.value = true;
let { oldPwd, newPwd } = userData;
if (ibiz.env.publicKey) {
if (ibiz.env.enableRSA) {
oldPwd = ibiz.util.text.rsa(oldPwd);
newPwd = ibiz.util.text.rsa(newPwd);
}
......@@ -116,7 +116,6 @@ export const ChangePassword = defineComponent({
title: res.data?.message || '修改密码失败',
});
}
console.log(props);
props.dismiss?.({ ok: true, data: {} });
loading.value = false;
} catch (error) {
......
......@@ -157,7 +157,7 @@ export const ForgetPassword = defineComponent({
loading.value = true;
const { loginName, verificationCode } = userData;
let { newPwd, comfirmPwd } = userData;
if (ibiz.env.publicKey) {
if (ibiz.env.enableRSA) {
newPwd = ibiz.util.text.rsa(newPwd);
comfirmPwd = ibiz.util.text.rsa(comfirmPwd);
}
......
......@@ -92,13 +92,15 @@ export default defineComponent({
loading.value = true;
clearCookie(CoreConst.TOKEN, true);
let password = loginData.password;
if ((ibiz.env as IData).enableSM3) {
password = ibiz.util.text.sm3(password).toUpperCase();
let verificationcode = loginData.verificationCode;
if ((ibiz.env as IData).enableRSA) {
password = ibiz.util.text.rsa(password);
verificationcode = ibiz.util.text.rsa(verificationcode);
}
const res = await ibiz.net.post('/v7/loginPwd', {
loginname: loginData.username,
password,
verificationcode: loginData.verificationCode,
verificationcode,
});
if (res.ok) {
const { data } = res;
......
......@@ -76,8 +76,8 @@ export default defineComponent({
loading.value = true;
clearCookie(CoreConst.TOKEN, true);
let password = loginData.password;
if ((ibiz.env as IData).enableSM3) {
password = ibiz.util.text.sm3(password).toUpperCase();
if ((ibiz.env as IData).enableRSA) {
password = ibiz.util.text.sm3(password);
}
const res = await ibiz.auth.v7login(loginData.username, password);
if (res.ok) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册