提交 0ed056d9 编写于 作者: Cano1997's avatar Cano1997

update: 未配置公钥时报错

上级 a5abbb59
...@@ -90,12 +90,16 @@ export const ChangePassword = defineComponent({ ...@@ -90,12 +90,16 @@ export const ChangePassword = defineComponent({
const loading = ref(false); const loading = ref(false);
const onClick = () => { const onClick = () => {
if (!ibiz.env.publicKey) {
ibiz.message.error('请联系系统管理员配置公钥');
return;
}
formRef.value!.validate(async (valid: boolean) => { formRef.value!.validate(async (valid: boolean) => {
if (valid) { if (valid) {
try { try {
loading.value = true; loading.value = true;
let { oldPwd, newPwd } = userData; let { oldPwd, newPwd } = userData;
if ((ibiz.env as IData).enableRSA) { if (ibiz.env.publicKey) {
oldPwd = ibiz.util.text.rsa(oldPwd); oldPwd = ibiz.util.text.rsa(oldPwd);
newPwd = ibiz.util.text.rsa(newPwd); newPwd = ibiz.util.text.rsa(newPwd);
} }
......
...@@ -121,13 +121,17 @@ export const ForgetPassword = defineComponent({ ...@@ -121,13 +121,17 @@ export const ForgetPassword = defineComponent({
}; };
const onClick = () => { const onClick = () => {
if (!ibiz.env.publicKey) {
ibiz.message.error('请联系系统管理员配置公钥');
return;
}
formRef.value!.validate(async (valid: boolean) => { formRef.value!.validate(async (valid: boolean) => {
if (valid) { if (valid) {
try { try {
loading.value = true; loading.value = true;
const { loginName, verificationCode } = userData; const { loginName, verificationCode } = userData;
let { newPwd, comfirmPwd } = userData; let { newPwd, comfirmPwd } = userData;
if ((ibiz.env as IData).enableRSA) { if (ibiz.env.publicKey) {
newPwd = ibiz.util.text.rsa(newPwd); newPwd = ibiz.util.text.rsa(newPwd);
comfirmPwd = ibiz.util.text.rsa(comfirmPwd); comfirmPwd = ibiz.util.text.rsa(comfirmPwd);
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册