修改註冊帳號問題

This commit is contained in:
kuei 2024-09-26 16:52:16 +08:00
parent b81dcf999f
commit 1530c332c9

View File

@ -95,6 +95,7 @@ class _RegisterPageState extends State<RegisterPage> {
try { try {
await send(message, smtpServer); await send(message, smtpServer);
print('驗證碼發送成功'); print('驗證碼發送成功');
print('生成的驗證碼是: $code');
} catch (e) { } catch (e) {
print('驗證碼發送失敗: $e'); print('驗證碼發送失敗: $e');
} }
@ -181,7 +182,6 @@ class _RegisterPageState extends State<RegisterPage> {
String name = _nameController.text; String name = _nameController.text;
String email = _emailController.text; String email = _emailController.text;
String password = _passwordController.text; String password = _passwordController.text;
var result = await conn.execute( var result = await conn.execute(
'SELECT * FROM HomeLogin WHERE homeEmail = :email OR homeUserName = :name', 'SELECT * FROM HomeLogin WHERE homeEmail = :email OR homeUserName = :name',
{'email': email, 'name': name}, {'email': email, 'name': name},
@ -196,7 +196,6 @@ class _RegisterPageState extends State<RegisterPage> {
'INSERT INTO HomeLogin (homeUserName, homeEmail, homePassword) VALUES (:name, :email, :password)', 'INSERT INTO HomeLogin (homeUserName, homeEmail, homePassword) VALUES (:name, :email, :password)',
{'name': name, 'email': email, 'password': password}, {'name': name, 'email': email, 'password': password},
); );
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('註冊成功!')), SnackBar(content: Text('註冊成功!')),
); );
@ -376,11 +375,32 @@ class VerifyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Verify Email'), title: Text('註冊成功'),
), ),
body: Center( body: Center(
child: Text('Email: $email'), child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Email: $email'),
SizedBox(height: 20),
ElevatedButton(
onPressed: () {
//
Navigator.pop(context);
},
child: Text('返回登入頁面'),
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(horizontal: 30, vertical: 15),
textStyle: TextStyle(fontSize: 18),
),
),
],
),
), ),
); );
} }
} }