aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/pages/login
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-08-26 23:49:28 +0800
committercrupest <crupest@outlook.com>2023-08-26 23:49:28 +0800
commit256cc9592a3f31fc392e1ccdb699aa206b7b47ce (patch)
treefdca6f8b1cdbd5ed264a1af9e48496685f4e9a95 /FrontEnd/src/pages/login
parentf5dfd52f6efece2f4cad227044ecf4dd66301bbc (diff)
downloadtimeline-256cc9592a3f31fc392e1ccdb699aa206b7b47ce.tar.gz
timeline-256cc9592a3f31fc392e1ccdb699aa206b7b47ce.tar.bz2
timeline-256cc9592a3f31fc392e1ccdb699aa206b7b47ce.zip
...
Diffstat (limited to 'FrontEnd/src/pages/login')
-rw-r--r--FrontEnd/src/pages/login/index.tsx14
1 files changed, 4 insertions, 10 deletions
diff --git a/FrontEnd/src/pages/login/index.tsx b/FrontEnd/src/pages/login/index.tsx
index 582ebd0f..39ea3831 100644
--- a/FrontEnd/src/pages/login/index.tsx
+++ b/FrontEnd/src/pages/login/index.tsx
@@ -6,11 +6,7 @@ import { useUser, userService } from "~src/services/user";
import { useC } from "~src/components/common";
import LoadingButton from "~src/components/button/LoadingButton";
-import {
- InputErrorDict,
- InputGroup,
- useInputs,
-} from "~src/components/input/InputGroup";
+import { InputGroup, useInputs } from "~src/components/input/InputGroup";
import Page from "~src/components/Page";
import "./index.css";
@@ -47,15 +43,13 @@ export default function LoginPage() {
label: "user.rememberMe",
},
],
- validator: ({ username, password }) => {
- const result: InputErrorDict = {};
+ validator: ({ username, password }, errors) => {
if (username === "") {
- result["username"] = "login.emptyUsername";
+ errors["username"] = "login.emptyUsername";
}
if (password === "") {
- result["password"] = "login.emptyPassword";
+ errors["password"] = "login.emptyPassword";
}
- return result;
},
},
dataInit: {},