fix: 修正重複註冊防呆邏輯
This commit is contained in:
parent
7d06f83d38
commit
00ec7d262f
|
|
@ -176,13 +176,13 @@ 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 OR homeName = :name',
|
||||||
{'email': email},
|
{'email': email, 'name': name},
|
||||||
);
|
);
|
||||||
|
|
||||||
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
|
// TODO: Phone Address is setting not null in database, remove it or setting default value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user