diff --git a/ui/src/components/Auth.vue b/ui/src/components/Auth.vue
index 47ef7c2..003e4ca 100644
--- a/ui/src/components/Auth.vue
+++ b/ui/src/components/Auth.vue
@@ -1,16 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -18,14 +21,12 @@
import { useAuthStore } from '@/store/auth';
import LoginForm from './LoginForm.vue';
import { ref } from 'vue';
-import { jwtDecode, type JwtPayload } from 'jwt-decode';
import RegisterForm from './RegisterForm.vue';
import UserInfo from './UserPanel.vue';
const loginMode = ref(0);
const authStore = useAuthStore();
-const token = ref(authStore.token);
@@ -35,6 +36,5 @@ const token = ref(authStore.token);
justify-content: center;
align-items: center;
height: 100vh;
- /* 设置容器高度为视口高度 */
}
\ No newline at end of file
diff --git a/ui/src/components/LoginForm.vue b/ui/src/components/LoginForm.vue
index 88b3685..e2a5554 100644
--- a/ui/src/components/LoginForm.vue
+++ b/ui/src/components/LoginForm.vue
@@ -1,41 +1,32 @@
-
+
-
-
+
-
+
-
+
-
+
-
-
- 警告:连续3次登录失败后,您的帐户将被暂时锁定三个小时。如果您必须立即登录,您还可以点击“忘记登录密码?”下面重置登录密码。
-
- 这只是个占位符文本,不知道为什么没有这段话整个布局就会乱成一坨,实际上我并没有做这个冻结功能。
-
-
+
+ 登录
+
-
- 登录
-
-
-
-
- 忘记密码
-
-
-
+
+
+ 忘记密码
+
+
-
+
@@ -79,7 +70,6 @@ const dialog = (title: string, text: string) => {
};
const login = async (userId: string, password: string) => {
- console.log('login', userId, password);
try {
const formData = new FormData;
formData.append("user_id", userId);
diff --git a/ui/src/components/RegisterForm.vue b/ui/src/components/RegisterForm.vue
index 44234ab..4445746 100644
--- a/ui/src/components/RegisterForm.vue
+++ b/ui/src/components/RegisterForm.vue
@@ -76,13 +76,11 @@ const dialog = (title: string, text: string) => {
};
const register = async (userId: string, password: string) => {
- console.log('login', userId, password);
try {
const formData = new FormData;
formData.append("user_id", userId);
formData.append("password", password);
let res = await axios.post('/api/auth/register', formData);
- console.log(res.data);
return res.data as RegisterResponse;
} catch (e) {
let ex = e as AxiosError;
@@ -93,10 +91,9 @@ const register = async (userId: string, password: string) => {
const submit = async (event: SubmitEvent) => {
const results: any = await event;
if (results.valid) {
- loading.value = true
- console.log('valid')
+ loading.value = true;
let res = await register(userId.value, password.value);
- loading.value = false
+ loading.value = false;
if (res?.error) {
dialog('错误', `注册失败:${res.error}`);
} else {
@@ -104,7 +101,6 @@ const submit = async (event: SubmitEvent) => {
model.value = 0;
}
}
- console.log(2);
};
const userIdRules: any = [(value: string) => {
diff --git a/ui/src/components/RepasswdDialog.vue b/ui/src/components/RepasswdDialog.vue
new file mode 100644
index 0000000..63f0d01
--- /dev/null
+++ b/ui/src/components/RepasswdDialog.vue
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改密码
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/components/UserPanel.vue b/ui/src/components/UserPanel.vue
index 2a9868d..404f1f0 100644
--- a/ui/src/components/UserPanel.vue
+++ b/ui/src/components/UserPanel.vue
@@ -4,9 +4,15 @@
用户 ID: {{ userId }}
-
+
退出登录
+
+ 修改密码
+
+
+ 删除账号
+
@@ -18,6 +24,15 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
+const logout = async () => {
+ authStore.clearToken();
+}
+
+
+
+
\ No newline at end of file