Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var url = 'rest/loginParametros';
- axios.post(url, {
- user: this.username,
- password: this.password
- })
- .then(function (response) {
- console.log(response);
- })
- .catch(function (error) {
- console.log(error);
- });
- @org.springframework.web.bind.annotation.RestController
- @RequestMapping("/rest")
- public class RestController {
- private final Log log = LogFactory.getLog(RestController.class);
- @PostMapping("/loginParametros")
- public ResponseEntity<Boolean> loginParametros(@RequestParam(value = "user", required = true) String user,
- @RequestParam(value = "password", required = true) String password)
- {
- log.info("user: " + user + " password: " + password);
- if(user.equals("hitzu") && password.equals("hitzu"))
- return new ResponseEntity<>(true, HttpStatus.OK);
- return new ResponseEntity<>(false, HttpStatus.OK);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement