This commit is contained in:
eson 2023-08-29 17:14:20 +08:00
parent 6ede8daee6
commit f7f5d497d9

View File

@ -185,6 +185,42 @@ func (l *UserEmailConfirmationLogic) AfterLogic(w http.ResponseWriter, r *http.R
w.Write([]byte(successHtml))
httpx.Ok(w)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
errorHtml := `
<!DOCTYPE html>
<html>
<head>
<title>注册失败</title>
<style>
body {
font-family: sans-serif;
font-size: 16px;
}
h1 {
font-size: 24px;
color: blue;
}
@media screen and (max-width: 480px) {
body {
font-size: 14px;
}
h1 {
font-size: 18px;
}
}
</style>
</head>
<body>
<h1>%s</h1>
</body>
</html>
`
errorHtml = fmt.Sprintf(errorHtml, resp.Message)
w.Write([]byte(errorHtml))
httpx.Ok(w)
}
}