forked from JinBinPeng/springboot-jwt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a918538
commit 7594e86
Showing
11 changed files
with
94 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/com/pjb/springbootjjwt/api/LoginController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.pjb.springbootjjwt.api; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
|
||
@Controller | ||
public class LoginController { | ||
|
||
@GetMapping(value = "/aaa") | ||
public String getLoginPage() { | ||
return "login"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ mybatis: | |
mapper-locations: classpath:mapper/*Mapper.xml | ||
debug: true | ||
server: | ||
port: 8888 | ||
port: 8123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>登录测试</title> | ||
<script src="js/jquery-3.6.0.min.js"></script> | ||
</head> | ||
<body> | ||
|
||
<style type="text/css"> | ||
#div_bg { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: #fff; | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
-webkit-background-size: cover; | ||
-o-background-size: cover; | ||
background-position: center 0; | ||
background-attachment: fixed; /*全屏居中的关键*/ | ||
} | ||
|
||
#button{ | ||
width:100px; | ||
height: 100px; | ||
background-color: palevioletred; | ||
} | ||
</style> | ||
|
||
<script type="text/javascript"> | ||
function postJson() { | ||
console.log('执行了postJson函数'); | ||
$.ajax({ | ||
url: 'http://localhost:8123/api/login', | ||
type: 'POST', | ||
data: '{"username":"strong", "password":"123456"}', | ||
contentType: 'application/json', | ||
success: function(data) { | ||
alert(data.message); | ||
} | ||
}); | ||
} | ||
</script> | ||
|
||
|
||
<div id="div_bg"> | ||
<button type="button" onclick="postJson()">测试</button> | ||
</div> | ||
|
||
</body> | ||
</html> |