From d84c7f3ea4d7373a684b170bfd89575e4c9c2127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Fri, 19 Aug 2022 14:30:04 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dbnt/faisp/config/SecurityConfig.java | 2 +- .../dbnt/faisp/controller/BaseController.java | 12 +- .../java/com/dbnt/faisp/model/UserInfo.java | 2 +- .../dbnt/faisp/service/UserInfoService.java | 2 +- src/main/resources/static/css/common.css | 39 +------ src/main/resources/static/js/common.js | 45 -------- .../resources/templates/fragments/header.html | 37 ++++-- .../templates/fragments/leftMenu.html | 106 ++++-------------- .../resources/templates/layout/layout.html | 16 +-- .../resources/templates/login/dashboard.html | 63 +++++++++++ .../resources/templates/login/signup.html | 15 --- 11 files changed, 125 insertions(+), 214 deletions(-) create mode 100644 src/main/resources/templates/login/dashboard.html delete mode 100644 src/main/resources/templates/login/signup.html diff --git a/src/main/java/com/dbnt/faisp/config/SecurityConfig.java b/src/main/java/com/dbnt/faisp/config/SecurityConfig.java index 6afd900a..82286fa3 100644 --- a/src/main/java/com/dbnt/faisp/config/SecurityConfig.java +++ b/src/main/java/com/dbnt/faisp/config/SecurityConfig.java @@ -59,7 +59,7 @@ public class SecurityConfig{ @Bean protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.authorizeRequests() // 페이지 권한 설정 - .antMatchers("/file/**", "/board/**", "/info/**").hasRole(Role.USER.name()) // USER, ADMIN 접근 허용 + .antMatchers("/dashboard").hasRole(Role.USER.name()) // USER, ADMIN 접근 허용 .antMatchers("/admin/**").hasRole(Role.ADMIN.name()) // ADMIN만 접근 허용 .antMatchers("/login").permitAll() // 로그인 페이지는 권한 없이 접근 허용 .and() // 로그인 설정 diff --git a/src/main/java/com/dbnt/faisp/controller/BaseController.java b/src/main/java/com/dbnt/faisp/controller/BaseController.java index 199c50b5..eac4f31c 100644 --- a/src/main/java/com/dbnt/faisp/controller/BaseController.java +++ b/src/main/java/com/dbnt/faisp/controller/BaseController.java @@ -23,11 +23,7 @@ public class BaseController { if(loginUser == null){ mav = new ModelAndView("redirect:/login"); }else{ - if(loginUser.getUserRole().indexOf("ADMIN")>0){ - mav = new ModelAndView("redirect:/admin/main"); - }else{ - mav = new ModelAndView("redirect:/board/main"); - } + mav = new ModelAndView("redirect:/dashboard"); } return mav; } @@ -56,4 +52,10 @@ public class BaseController { ModelAndView mav = new ModelAndView("login/denied"); return mav; } + + @GetMapping("/dashboard") + public ModelAndView dashboard() { + ModelAndView mav = new ModelAndView("login/dashboard"); + return mav; + } } diff --git a/src/main/java/com/dbnt/faisp/model/UserInfo.java b/src/main/java/com/dbnt/faisp/model/UserInfo.java index 7826269c..92f209d9 100644 --- a/src/main/java/com/dbnt/faisp/model/UserInfo.java +++ b/src/main/java/com/dbnt/faisp/model/UserInfo.java @@ -76,6 +76,6 @@ public class UserInfo extends BaseModel implements UserDetails{ @Override public boolean isEnabled() { - return userStatus.equals("ST002"); + return userStatus.equals("ST003"); } } diff --git a/src/main/java/com/dbnt/faisp/service/UserInfoService.java b/src/main/java/com/dbnt/faisp/service/UserInfoService.java index 36227b07..fe8db34b 100644 --- a/src/main/java/com/dbnt/faisp/service/UserInfoService.java +++ b/src/main/java/com/dbnt/faisp/service/UserInfoService.java @@ -27,7 +27,7 @@ public class UserInfoService implements UserDetailsService { return "userIdDuplication"; } userInfo.setUserRole(Role.USER.getValue()); - userInfo.setUserStatus("ST001"); + userInfo.setUserStatus("ST002"); userInfo.setPassword(convertPassword(userInfo.getPassword())); return userInfoRepository.save(userInfo).getUserId(); } diff --git a/src/main/resources/static/css/common.css b/src/main/resources/static/css/common.css index 7fe7e09d..d15b91a1 100644 --- a/src/main/resources/static/css/common.css +++ b/src/main/resources/static/css/common.css @@ -1,31 +1,3 @@ - -.centerDiv{ - max-height: fit-content; -} - -/*스크롤기능 있지만 안보이게*/ -body::-webkit-scrollbar { - display: none; -} - -/*사이드바 카테고리 트리*/ -.btn-toggle:hover, .btn-toggle:focus { - color: rgba(0, 0, 0, .85); - background-color: #d2f4ea; -} -.btn-toggle::before { - width: 1.25em; - line-height: 0; - content: url("/img/bootstrap-icons-1.7.1/caret-right-fill.svg"); - transition: transform .35s ease; - transform-origin: 0.5em 50%; -} -.btn-toggle[aria-expanded="true"]::before { - content: url("/img/bootstrap-icons-1.7.1/caret-down-fill.svg"); - /*왜 안돌까?*/ - /*transform: rotate(90deg);*/ -} - #fadeDiv{ width: 100%; height: 100%; @@ -42,13 +14,4 @@ body::-webkit-scrollbar { top: 50%; transform: translate(-50%, -50%); background-color: #ffffff; -} - -#list-group-line{ - padding-bottom: 52vh; -} - -/*@media (max-width:1199px)*/ -/* .sidebar {*/ -/* left: -300px;*/ -/* }*/ +} \ No newline at end of file diff --git a/src/main/resources/static/js/common.js b/src/main/resources/static/js/common.js index e7baa7af..2d9717ba 100644 --- a/src/main/resources/static/js/common.js +++ b/src/main/resources/static/js/common.js @@ -1,48 +1,3 @@ -let categorySeq; - -$(document).on('click', '#moveRightBtn', function (){ - moveCategorySelectBody(1); -}) -$(document).on('click', '#moveLeftBtn', function (){ - moveCategorySelectBody(-1); -}) -$(document).on('click', '.contentWriteBtn', function (){ - location.href="/board/contentWrite"+(categorySeq!==undefined?("?categorySeq="+categorySeq):""); -}) -function sessionReload(){ - $.ajax({ - url: '/refreshSession', - type: 'GET', - success: function(){location.reload();}, - error:function(){} - }); -} -function moveCategorySelectBody(direction){ - const categorySelectBody = $("#categorySelectBody"); - const nowX = categorySelectBody.scrollLeft(); - categorySelectBody.animate({scrollLeft:(direction*200+nowX)},200); -} -function setMenu(){ - const categorySeq = getParam("categorySeq"); - openMenu($("[data-categoryseq='"+categorySeq+"']").attr("data-parentseq")); -} - -function getParam(sname) { - const paramAry = location.search.substr(1).split("&"); - for (let i = 0; i < paramAry.length; i++) { - const param = paramAry[i].split("="); - if (param[0] === sname) { return param[1]; } - } -} - -function openMenu(parentSeq){ - if(parentSeq){ - const target = $("[data-categoryseq='"+parentSeq+"']") - target.click(); - openMenu(target.attr("data-parentseq")); - } -} - function contentFade(action){ if(action === "in"){ $("#fadeDiv").show() diff --git a/src/main/resources/templates/fragments/header.html b/src/main/resources/templates/fragments/header.html index d6a224c2..9d7daf72 100644 --- a/src/main/resources/templates/fragments/header.html +++ b/src/main/resources/templates/fragments/header.html @@ -2,14 +2,33 @@ -
- - - - - +
+
+ + + + +
+
+ +
+
+ +
\ No newline at end of file diff --git a/src/main/resources/templates/fragments/leftMenu.html b/src/main/resources/templates/fragments/leftMenu.html index f4284e30..ee72347d 100644 --- a/src/main/resources/templates/fragments/leftMenu.html +++ b/src/main/resources/templates/fragments/leftMenu.html @@ -2,92 +2,24 @@ -
-
- -
- - -
-
-
    - -
  • - -
    -
      - -
    • -
        -
      • - -
        -
          - -
        • -
            -
          • - -
            -
              - -
            • -
              - -
            • 등록된 소분류가 없습니다.
            • -
              -
            -
            -
          • -
          -
        • -
          - -
        • 등록된 중분류가 없습니다.
        • -
          -
        -
        -
      • -
      -
    • -
      - -
    • 등록된 연도가 없습니다.
    • -
      - -
    -
    -
  • -
    -
-
-
+ \ No newline at end of file diff --git a/src/main/resources/templates/layout/layout.html b/src/main/resources/templates/layout/layout.html index 0bdf6ff6..9921d57a 100644 --- a/src/main/resources/templates/layout/layout.html +++ b/src/main/resources/templates/layout/layout.html @@ -35,25 +35,17 @@
-
-
-