fix: 修正重複註冊防呆邏輯
This commit is contained in:
@@ -176,8 +176,8 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
String password = _passwordController.text;
|
||||
|
||||
var result = await conn.execute(
|
||||
'SELECT * FROM HomeLogin WHERE homeEmail = :email AND homePassword = :password',
|
||||
{'email': email, 'password': password},
|
||||
'SELECT * FROM HomeLogin WHERE homeEmail = :email',
|
||||
{'email': email},
|
||||
);
|
||||
|
||||
if (result.rows.isNotEmpty) {
|
||||
@@ -185,6 +185,7 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
SnackBar(content: Text('註冊失敗:電子信箱已被使用,請嘗試更換電子信箱')),
|
||||
);
|
||||
} else {
|
||||
// TODO: Phone Address is setting not null in database, remove it or setting default value
|
||||
await conn.execute(
|
||||
'INSERT INTO HomeLogin (homeName, homeEmail, homePassword) VALUES (:name, :email, :password)',
|
||||
{'name': name, 'email': email, 'password': password},
|
||||
|
||||
Reference in New Issue
Block a user