增加登录时邮箱格式验证
This commit is contained in:
parent
a975d936bb
commit
5e6cbfb320
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@ -1 +1 @@
|
|||||||
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站</title><script defer="defer" src="/js/chunk-vendors.f3a85c9b.js"></script><script defer="defer" src="/js/app.57b215d7.js"></script><link href="/css/app.bc7fcac0.css" rel="stylesheet"></head><body><noscript><strong>抱歉,NEU小站无法在没有 JavaScript 的情况下正常工作。请启用 JavaScript 以继续。</strong></noscript><div id="app"></div></body></html>
|
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站</title><script defer="defer" src="/js/chunk-vendors.f3a85c9b.js"></script><script defer="defer" src="/js/app.100c0fce.js"></script><link href="/css/app.91c3e0f8.css" rel="stylesheet"></head><body><noscript><strong>抱歉,NEU小站无法在没有 JavaScript 的情况下正常工作。请启用 JavaScript 以继续。</strong></noscript><div id="app"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
dist/js/app.100c0fce.js
vendored
Normal file
2
dist/js/app.100c0fce.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/js/app.57b215d7.js
vendored
2
dist/js/app.57b215d7.js
vendored
File diff suppressed because one or more lines are too long
@ -18,6 +18,8 @@
|
|||||||
placeholder="请输入邮箱地址"
|
placeholder="请输入邮箱地址"
|
||||||
required
|
required
|
||||||
class="form-input"
|
class="form-input"
|
||||||
|
pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"
|
||||||
|
title="请输入有效的邮箱地址"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -137,6 +139,14 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 验证邮箱格式
|
||||||
|
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||||
|
if (!emailRegex.test(this.email)) {
|
||||||
|
this.message = '请输入有效的邮箱地址';
|
||||||
|
this.messageIsError = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.loadingMessage = '登录中...';
|
this.loadingMessage = '登录中...';
|
||||||
|
|
||||||
@ -185,6 +195,14 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 验证邮箱格式
|
||||||
|
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||||
|
if (!emailRegex.test(this.email)) {
|
||||||
|
this.message = '请输入有效的邮箱地址';
|
||||||
|
this.messageIsError = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await this.sendRegisterCode();
|
await this.sendRegisterCode();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user