修改註冊帳號問題
This commit is contained in:
@@ -95,6 +95,7 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
try {
|
||||
await send(message, smtpServer);
|
||||
print('驗證碼發送成功');
|
||||
print('生成的驗證碼是: $code');
|
||||
} catch (e) {
|
||||
print('驗證碼發送失敗: $e');
|
||||
}
|
||||
@@ -181,7 +182,6 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
String name = _nameController.text;
|
||||
String email = _emailController.text;
|
||||
String password = _passwordController.text;
|
||||
|
||||
var result = await conn.execute(
|
||||
'SELECT * FROM HomeLogin WHERE homeEmail = :email OR homeUserName = :name',
|
||||
{'email': email, 'name': name},
|
||||
@@ -196,7 +196,6 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
'INSERT INTO HomeLogin (homeUserName, homeEmail, homePassword) VALUES (:name, :email, :password)',
|
||||
{'name': name, 'email': email, 'password': password},
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('註冊成功!')),
|
||||
);
|
||||
@@ -376,11 +375,32 @@ class VerifyPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Verify Email'),
|
||||
title: Text('註冊成功'),
|
||||
),
|
||||
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),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user