|
|
|
@@ -6,6 +6,7 @@ import com.moze.rms.entity.model.Account; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.Locale; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
@@ -18,7 +19,7 @@ public class AccountController { |
|
|
|
|
|
|
|
@PostMapping("/login") |
|
|
|
public JsonResult login(@RequestBody Map<String, String> data) { |
|
|
|
Optional<Map<String, Object>> user = accountDAO.findUser(data.get("account")); |
|
|
|
Optional<Map<String, Object>> user = accountDAO.findUser(data.get("account").toLowerCase()); |
|
|
|
if (user.isPresent() && user.get().get("pwd").equals(data.get("password"))) { |
|
|
|
return new JsonResult(StatusCode.SUCCESS, user); |
|
|
|
} else { |
|
|
|
|