提交 9cc2729e 编写于 作者: zhangpingchuan's avatar zhangpingchuan

feat: 更新登录获取验证码功能

上级 63cbad8c
...@@ -114,12 +114,18 @@ export default defineComponent({ ...@@ -114,12 +114,18 @@ export default defineComponent({
} }
} }
ibiz.notification.error({ ibiz.notification.error({
title: res.data?.message || '登录失败', title: res.data?.message?.includes('用户名或密码错误')
? '用户名或密码错误'
: '登录失败',
}); });
loading.value = false; loading.value = false;
} catch (error) { } catch (error) {
ibiz.notification.error({ ibiz.notification.error({
title: (error as IData).response?.data?.message || '登录失败', title: (error as IData).response?.data?.message?.includes(
'用户名或密码错误',
)
? '用户名或密码错误'
: '登录失败',
}); });
loading.value = false; loading.value = false;
} }
...@@ -159,14 +165,27 @@ export default defineComponent({ ...@@ -159,14 +165,27 @@ export default defineComponent({
const sendVerificationCode = () => { const sendVerificationCode = () => {
const { username } = loginData; const { username } = loginData;
let { password } = loginData;
if (!username) { if (!username) {
ibiz.notification.warning({ ibiz.notification.warning({
title: '请先输入账号', title: '请先输入账号',
}); });
return; return;
} }
if (!password) {
ibiz.notification.warning({
title: '请先输入密码',
});
return;
}
if (ibiz.env.enableRSA) {
password = ibiz.util.text.rsa(password);
}
ibiz.net ibiz.net
.post(`/v7/loginPwd/sendVerificationCode/${username}`, {}) .post(`/v7/loginPwd/sendVerificationCode/${username}`, {
loginname: username,
password,
})
.then((res: IData) => { .then((res: IData) => {
standCountdown(); standCountdown();
if (res.ok) { if (res.ok) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册