Compare commits

..

No commits in common. "7d06f83d381be18cf394891759a53e584eea1154" and "cf3abfc12bc3acc2913d6536631b55ce34b707ac" have entirely different histories.

2 changed files with 4 additions and 4 deletions

View File

@ -139,6 +139,7 @@ class _PersonalInfoState extends State<PersonalInfo> {
} catch (e) { } catch (e) {
print('Error: $e'); print('Error: $e');
} finally { } finally {
await conn.close();
await conn.close(); await conn.close();
print('finally儲存更新狀態:$_isEditing'); print('finally儲存更新狀態:$_isEditing');
} }

View File

@ -176,16 +176,15 @@ class _RegisterPageState extends State<RegisterPage> {
String password = _passwordController.text; String password = _passwordController.text;
var result = await conn.execute( var result = await conn.execute(
'SELECT * FROM HomeLogin WHERE homeEmail = :email', 'SELECT * FROM HomeLogin WHERE homeEmail = :email AND homePassword = :password',
{'email': email}, {'email': email, 'password': password},
); );
if (result.rows.isNotEmpty) { if (result.rows.isNotEmpty) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('註冊失敗:電子信箱已被使用,請嘗試更換電子信箱')), SnackBar(content: Text('登入失敗:帳號或密碼錯誤')),
); );
} else { } else {
// TODO: Phone Address is setting not null in database, remove it or setting default value
await conn.execute( await conn.execute(
'INSERT INTO HomeLogin (homeName, homeEmail, homePassword) VALUES (:name, :email, :password)', 'INSERT INTO HomeLogin (homeName, homeEmail, homePassword) VALUES (:name, :email, :password)',
{'name': name, 'email': email, 'password': password}, {'name': name, 'email': email, 'password': password},