Skip to content
Snippets Groups Projects
Commit 34a04ce4 authored by Mingyuan Chen's avatar Mingyuan Chen
Browse files

Merge branch 'main' into 'master'

# Conflicts:
#   src/main/resources/static/html/login.html
parents 51cc5e05 b1e35f0e
No related branches found
No related tags found
1 merge request!9Updated the Login authentication function
File added
......@@ -13,9 +13,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
*/
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/*.html")
.addResourceLocations("classpath:/static/html/")
.addResourceLocations("/*.img")
.addResourceLocations("classpath:/static/img/");
.addResourceLocations("classpath:/static/html/");
}
}
......@@ -18,12 +18,13 @@ public class UserLogin implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
System.out.println(username);
SuperUser inforByName = superAdminMapper.getInforByName(username);
System.out.println(inforByName);
String type = superAdminMapper.getTypeById(inforByName.getRoleId());
System.out.println(type);
SimpleGrantedAuthority authority = new SimpleGrantedAuthority(type);
System.out.println(authority);
UserDetails userDetails = User.withUsername(inforByName.getName()).password(inforByName.getPassword()).authorities(authority).build();
return userDetails;
}
......
body {
font-family: Arial, sans-serif;
//background: linear-gradient(135deg, #d4f0fc, #add8e6);
color: #333;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-image:url("../img/backpicture.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
main {
background: #fff;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 20px 30px;
text-align: center;
max-width: 400px;
width: 100%;
filter: opacity(90%);
}
p {
margin: 10px 0;
font-size: 16px;
}
#time {
font-size: 20px;
color: #555;
font-weight: bold;
}
button {
background: #0078d4;
color: #fff;
border: none;
border-radius: 5px;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
transition: background 0.3s ease;
margin-top: 15px;
}
button:hover {
background: #005fa3;
}
\ No newline at end of file
.login-container {
width: 300px;
padding: 20px;
background-color: #fff;
border-radius: 8px;
filter: opacity(90%);
/* box-shadow: 10px 5px 5px rgba(0, 0, 0, 0.1);*/
/*!*rgba(0, 0, 0, 0.1);*!*/
}
.login-container h2 {
text-align: center;
color: #333;
}
.login-container label {
font-size: 14px;
color: #555;
}
#username,#password{
width: 95%;
padding: 10px;
margin: 10px 0 20px;
border: 1px solid #ccc;
border-radius: 4px;
}
.login-container button {
width: 100%;
padding: 10px;
background-color: #4CAF50;
border: none;
color: white;
font-size: 16px;
border-radius: 4px;
cursor: pointer;
}
.login-container button:hover {
background-color: #45a049;
}
\ No newline at end of file
......@@ -3,20 +3,26 @@
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="/css/fault.css">
</head>
<body>
<main>
<p >If you do not have sufficient access rights, the page will be redirected to the login page within 10 seconds</p>
<p id="time"></p>
<p >
You do not have sufficient access rights, the page will be redirected to the login page within
<span id="time">10</span>
seconds
</p>
<button onclick="skip()">Immediate jump</button>
</main>
</body>
<script>
//Triggered when the document is loaded and the DOM tree is built.
window.addEventListener("DOMContentLoaded", function() {
var text = document.getElementById('time')
console.log(text.innerText)
let i = 10;
//Create timer
var timer = setInterval(function() {
i--;
text.innerHTML = i;
......@@ -29,7 +35,7 @@
})
// 如果点击立即返回按钮直接返回主页面
// If you click the Back Now button, go directly to the main page
function skip(){
window.location.href="login.html"
}
......
src/main/resources/static/img/R.jpg

30.5 KiB

src/main/resources/static/img/backpicture.jpg

242 KiB

Image diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment