Skip to content
Snippets Groups Projects
Commit 33d8fe63 authored by Yulong Wang's avatar Yulong Wang
Browse files

Merge branch...

Merge branch '16-as-a-user-i-want-have-a-page-to-insert-my-information-when-i-want-to-visit-this-website-i-can-2' into 'main'

finish

Closes #16

See merge request c24025433/healthcare!36
parents 753655b9 2b27ff09
No related branches found
No related tags found
No related merge requests found
......@@ -20,13 +20,13 @@ public class AuthenticationSuccessHandler implements org.springframework.securit
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException{
System.out.println(authentication);
String authorities = authentication.getAuthorities().toString();
System.out.println("authorities: " + authorities);
// Configuration response
response.setContentType("application/json;charset=UTF-8");
ObjectMapper objectMapper = new ObjectMapper();
String jsonResponse = objectMapper.writeValueAsString(Result.success(authorities));
String jsonResponse = objectMapper.writeValueAsString(Result.success(authorities+","+authentication.getName()));
response.getWriter().write(jsonResponse);
}
}
......@@ -44,16 +44,16 @@ public class SuperAdminServiceImp implements SuperAdminService {
Result result = null;
if(signDTO.getRole().equals("HOSPITAL")){
Hospital hospital = new Hospital();
hospital.setRoleId(Authority.HOSPITAL);
BeanUtils.copyProperties(signDTO,hospital);
hospital.setRoleId(Authority.HOSPITAL);
hospital.setPassword(passwordEncoder.encode(hospital.getPassword()));
result= superAdminMapper.insertHospitalInform(hospital);
}
if (signDTO.getRole().equals("ADMIN")) {
CommonAdmin commonAdmin = new CommonAdmin();
commonAdmin.setRoleId(Authority.ADMIN);
BeanUtils.copyProperties(signDTO,commonAdmin);
commonAdmin.setRoleId(Authority.ADMIN);
commonAdmin.setPassword(passwordEncoder.encode(commonAdmin.getPassword()));
result=superAdminMapper.insertUserInform(commonAdmin);
}
......
......@@ -149,9 +149,12 @@
window.location.href = "login.html";
} else {
console.log(data.msg);
var type = data.msg;
var itemsArray=data.msg.split(",");
var type=itemsArray[0];
var item=itemsArray[1];
console.log(itemsArray)
if (type == "[" + "SUPER" + "]") {
window.location.href = "superAdminView.html";
window.location.href = "superAdminView.html";
}
if (type == "[" + "ADMIN" + "]") {
window.location.href = "admin.html";
......@@ -160,7 +163,7 @@
window.location.href = "";
}
if (type == "[" + "HOSPITAL" + "]") {
window.location.href = "";
window.location.href = `?item=${item}`;
}
if(type=="[" + "NULL" + "]"){
window.location.href="fault.html";
......
......@@ -23,7 +23,10 @@
<div id="container" style="display: flex; flex-direction: column; height: 100vh;">
<!-- top area -->
<div id="top" style="background-color: black; height: 10vh; width: 100%"></div>
<div id="top" style="border-radius: 15px;margin-bottom:5px;background-color: #2c3e50; height: 10vh; width: 100%; display: flex; align-items: center; justify-content: center; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);">
<span style="color: #ecf0f1; font-size: 1.5rem; font-weight: bold; font-family: 'Arial', sans-serif;">Digital Insight for Health</span>
</div>
<!-- main block,left and right -->
<div style="display: flex; height: 80vh;">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment