Skip to content

Commit

Permalink
fix: correct display of email verification message toast (#6822)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/area core
/kind bug
/milestone 2.20.x

#### What this PR does / why we need it:

修复不能正常显示邮箱验证提示的问题。

#### Does this PR introduce a user-facing change?

```release-note
None
```
  • Loading branch information
ruibaby authored Oct 11, 2024
1 parent 59a5971 commit d63eaed
Showing 1 changed file with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<form
th:fragment="form"
class="halo-form"
name="signup-form"
id="signup-form"
th:action="@{/signup}"
th:object="${form}"
method="post"
th:fragment="form"
class="halo-form"
name="signup-form"
id="signup-form"
th:action="@{/signup}"
th:object="${form}"
method="post"
>
<div class="alert alert-error" role="alert" th:if="${error == 'invalid-email-code'}">
<strong>
Expand All @@ -27,18 +27,18 @@
<label for="username" th:text="#{form.username.label}"></label>
<div class="form-input">
<input
type="text"
id="username"
name="username"
autocomplete="off"
spellcheck="false"
autocorrect="off"
autocapitalize="off"
autofocus
required
minlength="4"
maxlength="63"
th:field="*{username}"
type="text"
id="username"
name="username"
autocomplete="off"
spellcheck="false"
autocorrect="off"
autocapitalize="off"
autofocus
required
minlength="4"
maxlength="63"
th:field="*{username}"
/>
</div>
<p class="alert alert-error" th:if="${#fields.hasErrors('username')}" th:errors="*{username}"></p>
Expand All @@ -48,15 +48,15 @@
<label for="displayName" th:text="#{form.displayName.label}"></label>
<div class="form-input">
<input
type="text"
id="displayName"
name="displayName"
autocomplete="off"
spellcheck="false"
autocorrect="off"
autocapitalize="off"
required
th:field="*{displayName}"
type="text"
id="displayName"
name="displayName"
autocomplete="off"
spellcheck="false"
autocorrect="off"
autocapitalize="off"
required
th:field="*{displayName}"
/>
</div>
<p class="alert alert-error" th:if="${#fields.hasErrors('displayName')}" th:errors="*{displayName}"></p>
Expand All @@ -68,15 +68,15 @@
<label for="email" th:text="#{form.email.label}"></label>
<div class="form-input">
<input
type="email"
id="email"
name="email"
autocomplete="off"
spellcheck="false"
autocorrect="off"
autocapitalize="off"
required
th:field="*{email}"
type="email"
id="email"
name="email"
autocomplete="off"
spellcheck="false"
autocorrect="off"
autocapitalize="off"
required
th:field="*{email}"
/>
</div>
<p class="alert alert-error" th:if="${#fields.hasErrors('email')}" th:errors="*{email}"></p>
Expand All @@ -98,15 +98,15 @@
<div class="form-item">
<label for="password" th:text="#{form.password.label}"></label>
<th:block
th:replace="~{gateway_fragments/input :: password(id = 'password', name = 'password', required = 'true', minlength = 5, maxlength = 257, enableToggle = true)}"
th:replace="~{gateway_fragments/input :: password(id = 'password', name = 'password', required = 'true', minlength = 5, maxlength = 257, enableToggle = true)}"
></th:block>
<p class="alert alert-error" th:if="${#fields.hasErrors('password')}" th:errors="*{password}"></p>
</div>

<div class="form-item">
<label for="confirmPassword" th:text="#{form.confirmPassword.label}"></label>
<th:block
th:replace="~{gateway_fragments/input :: password(id = 'confirmPassword', name = 'confirmPassword', required = 'true', minlength = 5, maxlength = 257, enableToggle = true)}"
th:replace="~{gateway_fragments/input :: password(id = 'confirmPassword', name = 'confirmPassword', required = 'true', minlength = 5, maxlength = 257, enableToggle = true)}"
></th:block>
<p class="alert alert-error" th:if="${#fields.hasErrors('confirmPassword')}" th:errors="*{confirmPassword}"></p>
</div>
Expand All @@ -128,7 +128,7 @@
const email = document.getElementById("email").value;

if (!email) {
throw new Error(/*[[#{form.signup.emailCode.send.emptyValidation}]]*/"");
throw new Error(/*[[#{form.emailCode.send.emptyValidation}]]*/"");
}

fetch("/signup/send-email-code", {
Expand All @@ -155,4 +155,4 @@
sendVerificationCode(emailCodeSendButton, sendRequest);
});
</script>
</form>
</form>

0 comments on commit d63eaed

Please sign in to comment.