diff --git a/lib/RegisterPage.dart b/lib/RegisterPage.dart index 17fd5dd..6919bc8 100644 --- a/lib/RegisterPage.dart +++ b/lib/RegisterPage.dart @@ -115,13 +115,13 @@ class _RegisterPageState extends State { } void registerBtn() async { - // TODO: 驗證碼未實作驗證 + if (!_isDataCorrect()) return; final conn = await MySQLConnection.createConnection( - host: '10.0.2.2', - port: 3306, + host: '203.64.84.154', + port: 33061, userName: 'root', - password: '0000', - databaseName: 'testdb', + password: 'Topic@2024', + databaseName: 'care', ); await conn.connect(); @@ -131,7 +131,7 @@ class _RegisterPageState extends State { String password = _passwordController.text; var result = await conn.execute( - 'SELECT * FROM users WHERE email = :email AND password = :password', + 'SELECT * FROM HomeLogin WHERE homeEmail = :email AND homePassword = :password', {'email': email, 'password': password}, ); @@ -141,7 +141,7 @@ class _RegisterPageState extends State { ); } else { await conn.execute( - 'INSERT INTO users (name, email, password) VALUES (:name, :email, :password)', + 'INSERT INTO HomeLogin (homeName, homeEmail, homePassword) VALUES (:name, :email, :password)', {'name': name, 'email': email, 'password': password}, );