Compare commits

...

3 Commits

Author SHA1 Message Date
JingChiang
7d06f83d38 fix: 修正重複註冊防呆邏輯 2024-09-08 20:45:54 +08:00
JingChiang
c3533e6338 notNecessary: 修正文字提示 2024-09-08 20:44:50 +08:00
JingChiang
09d4346608 fix: fix MySQLClient close not exisit connection 2024-09-08 20:37:27 +08:00
2 changed files with 4 additions and 4 deletions

View File

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

View File

@@ -176,15 +176,16 @@ 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) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('登入失敗:帳號或密碼錯誤')),
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},