feat: implement user registration API and connect to UI

This commit is contained in:
2025-06-18 16:01:28 +08:00
parent ca74d9a400
commit 0d98d4f0c2
2 changed files with 31 additions and 2 deletions

View File

@ -118,7 +118,15 @@ async function handleLogin() {
}
async function handleRegister() {
// TODO: Implement register logic
console.log('Registering with data:', registerForm);
try {
const response = await $fetch('/api/register', {
method: 'POST',
body: registerForm
});
message.value = response.message;
showLogin();
} catch (error: any) {
message.value = error.data?.message || '注册失败';
}
}
</script>