From 482beb3df3a0d1027361c87cb0d34c6e54588d2a Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Wed, 8 Mar 2017 21:27:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9login=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BookFloatingServer.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/BookFloatingServer.java b/BookFloatingServer.java index 7877e8f..75bca96 100644 --- a/BookFloatingServer.java +++ b/BookFloatingServer.java @@ -64,10 +64,27 @@ class Handle implements Runnable int ret=BookFloatingServer.Register(reg.getEmail(), reg.getPass(), reg.getNickname(), reg.getSchool()); System.out.println("Register Finished. Ret("+ret+")"); pw.write("{'ret':'"+ret+"'}"); + pw.flush(); } break; case "login": - break; + { + LoginData login=null; + try + { + login=gson.fromJson(str, LoginData.class); + } + catch(Exception e) + { + System.out.println("Incorrect Login Data"); + break; + } + + int ret=BookFloatingServer.Login(login.getEmail(),login.getPass()); + pw.write("{'ret':'"+ret+"'}"); + pw.flush(); + } + break; case "getpart": break; case "getfull":