mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: Send-code-button-should-be-gray-out-with-empty-or-invalid-Email-or-phone
Signed-off-by: wasabi <690898835@qq.com>
This commit is contained in:
@ -26,6 +26,12 @@ export let ServerUrl = "";
|
||||
// export const StaticBaseUrl = "https://cdn.jsdelivr.net/gh/casbin/static";
|
||||
export const StaticBaseUrl = "https://cdn.casbin.org";
|
||||
|
||||
// reference link: https://github.com/yiminghe/async-validator/blob/057b0b047f88fac65457bae691d6cb7c6fe48ce1/src/rule/type.ts#L9
|
||||
export const EmailRegEx = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
|
||||
// reference link: https://learnku.com/articles/31543, `^s*$` filter empty email individually.
|
||||
export const PhoneRegEx = /^\s*$|^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
|
||||
|
||||
export function initServerUrl() {
|
||||
const hostname = window.location.hostname;
|
||||
if (hostname === "localhost") {
|
||||
|
Reference in New Issue
Block a user