From 8f27ec0d2d7b56ce67a0c71b9fc3ac3aa32b1e0b Mon Sep 17 00:00:00 2001
From: wyl <wangyulong990316@outlook.com>
Date: Wed, 11 Dec 2024 12:49:17 +0000
Subject: [PATCH] update system construction

---
 .../client_project/config/WebSecurityConfig.java     |  6 +++---
 src/main/resources/application-dev.yml               |  6 +++---
 src/main/resources/application.yml                   | 12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/cardiff/client_project/config/WebSecurityConfig.java b/src/main/java/com/cardiff/client_project/config/WebSecurityConfig.java
index 33028ca..fe2fac1 100644
--- a/src/main/java/com/cardiff/client_project/config/WebSecurityConfig.java
+++ b/src/main/java/com/cardiff/client_project/config/WebSecurityConfig.java
@@ -51,9 +51,9 @@ public class WebSecurityConfig{
     // Turn off the csrf mechanism, you can use get login, otherwise you can only use post
         http    .csrf(csrf-> csrf.disable())
                 .authorizeHttpRequests(requests -> requests
-                        .requestMatchers("/device.html").hasRole("ADMIN")
-                        //+.requestMatchers("/superAdminView.html").hasRole("SUPER")
-                        .requestMatchers("/commonUser.html").authenticated()
+                        .requestMatchers("/superAdminView.html").hasRole("SUPER")
+                        .requestMatchers("/hospitalView.html").hasRole("HOSPITAL")
+                        .requestMatchers("/admin.html").hasRole("ADMIN")
                         .anyRequest().permitAll()
 
                 )
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 016cd27..0b86801 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -1,6 +1,6 @@
 healthcare:
   datasource:
-    url: jdbc:mariadb://localhost:3307/healthcare
-    port: 3307
+    url: jdbc:mariadb://localhost:3306/healthcare?createDatabaseIfNotExist=true
+    port: 3306
     username: root
-    password: root
\ No newline at end of file
+    password: comsc
\ No newline at end of file
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index ccda0b6..6263e3e 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -8,12 +8,12 @@ spring:
     username: ${healthcare.datasource.username}
     password: ${healthcare.datasource.password}
     port: ${healthcare.datasource.port}
-  sql:
-    init:
-      schema-locations: classpath:schema.sql
-      data-locations: classpath:data.sql
-      platform: mariadb
-      mode: always
+    sql:
+      init:
+        schema-locations: classpath:schema.sql
+        data-locations: classpath:data.sql
+        platform: mariadb
+        mode: always
   thymeleaf:
     prefix: classpath:/templates/
     suffix: .html
-- 
GitLab